Snapshots Have Stopped Running On Some VMs

2019-05-02 Thread Asai
Greetings,

I have been doing some maintenance on my Cloudstack instance (4.11.1.0) and I 
have found that some of my VM snapshots quit running back in February.  I have 
found this error in the management-server.log.

2019-05-02 10:01:21,547 DEBUG [c.c.s.StorageManagerImpl] 
(StorageManager-Scavenger-1:ctx-5b4e7b0e) (logid:00439c5c) Secondary storage 
garbage collector found 252 snapshots to cleanup on snapshot_store_ref for 
store: Avalon Secondary Storage
2019-05-02 10:01:21,552 WARN  [c.c.s.StorageManagerImpl] 
(StorageManager-Scavenger-1:ctx-5b4e7b0e) (logid:00439c5c) problem cleaning up 
snapshots in snapshot_store_ref for store: Avalon Secondary Storage
at 
org.apache.cloudstack.storage.snapshot.SnapshotObject.getId(SnapshotObject.java:159)
at 
org.apache.cloudstack.storage.snapshot.SnapshotObject.getChild(SnapshotObject.java:124)

Can anyone shed some light on this, and advise how I can get my snapshots 
running again?
Asai




Help with configDrive label issue/discrepancy

2019-05-02 Thread Jean-Francois Nadeau
Good morning all,

I have this strange configDrive problem that shows up on 4.11.2 and only if
upgraded from 4.9.

This problems shows up with the DefaultL2NetworkOfferingConfigDriveVlan
network offering

In lab and a fresh 4.11.2.0 install,  the configDrive enabled network will
present an ISO to guest VMs with the expected "config-2" label and
cloud-init works just fine:

Ie:
# blkid /dev/sr1
/dev/sr1: UUID="2019-04-26-20-57-31-00" LABEL="config-2" TYPE="iso9660"

On our production 4.11.2 upgraded months ago from 4.9.3 (but running with
the same 4.11.2.0 systemvm templates as the lab),   here's the configdrive
ISO label with the same network offering:

# blkid /dev/sr1
/dev/sr1: UUID="2019-05-01-21-30-20-00" LABEL="config" TYPE="iso9660"

In this case cloud-init doesn't identify this label as a configDrive DS and
fail to apply user-data.

Im trying to find where this happens and can be changed.  Any clue anyone ?

best,

Jfn


Re: Cloudstack-agent gets the local IP address exception

2019-05-02 Thread Nux!
Thanks Wei, I've opened a proper issue for this, hope your fix gets applied.

https://github.com/apache/cloudstack/issues/3311

--
Sent from the Delta quadrant using Borg technology!

Nux!
www.nux.ro

- Original Message -
> From: "Wei ZHOU" 
> To: "dev" 
> Cc: "users" 
> Sent: Wednesday, 1 May, 2019 21:52:06
> Subject: Re: Cloudstack-agent gets the local IP address exception

> Hi Nux,
> 
> It is because NetworkInterface.getInterfaceAddresses() returns the ips in
> reverse order.
> For example, "ip addr show dev eth0"  shows the following ips
> inet X.X.X.X
> inet secondary Y.Y.Y.Y
> inet6 Z:Z:Z:Z:Z:Z
> 
> Then NetworkInterface.getInterfaceAddresses returns
> Z:Z:Z:Z:Z:Z
> Y.Y.Y.Y
> X.X.X.X
> 
> The following patch should work as you expect.
> 
> ```
> diff --git a/utils/src/main/java/com/cloud/utils/net/NetUtils.java
> b/utils/src/main/java/com/cloud/utils/net/NetUtils.java
> index afe73f1..afb0ce6 100644
> --- a/utils/src/main/java/com/cloud/utils/net/NetUtils.java
> +++ b/utils/src/main/java/com/cloud/utils/net/NetUtils.java
> @@ -32,6 +32,7 @@ import java.net.SocketException;
> import java.net.URI;
> import java.net.UnknownHostException;
> import java.util.ArrayList;
> +import java.util.Collections;
> import java.util.Formatter;
> import java.util.List;
> import java.util.Random;
> @@ -394,10 +395,11 @@ public class NetUtils {
> }
> 
> public static String[] getNetworkParams(final NetworkInterface nic) {
> -final List addrs = nic.getInterfaceAddresses();
> +List addrs = nic.getInterfaceAddresses();
> if (addrs == null || addrs.size() == 0) {
> return null;
> }
> +Collections.reverse(addrs);
> InterfaceAddress addr = null;
> for (final InterfaceAddress iaddr : addrs) {
> final InetAddress inet = iaddr.getAddress();
> ```
> 
> 
> -Wei
> 
> 
> 
> Nux!  于2019年5月1日周三 下午4:00写道:
> 
>> I ran into a similar problem when I tried to allocate an additional IP on
>> the agent machine (for other purposes), the hypervisor would then show up
>> in the UI with this new IP and in "Alert" state.
>>
>> I solved the problem by moving the IP out of br0 and on to the loopback
>> interface.
>>
>> --
>> Sent from the Delta quadrant using Borg technology!
>>
>> Nux!
>> www.nux.ro
>>
>> - Original Message -
>> > From: "li jerry" 
>> > To: "users" , "dev" <
>> d...@cloudstack.apache.org>
>> > Sent: Monday, 22 April, 2019 14:36:51
>> > Subject: Cloudstack-agent gets the local IP address exception
>>
>> > HI All
>> >
>> >
>> > my kvm host [ip:10.226.16.11] virtualized a vip[10.226.16.10] via
>> keepalived.
>> >
>> > After I started the cloudstack-agent, I got vip[10.226.16.10] and I
>> couldn't get
>> > the correct IP [10.226.16.11];
>> >
>> > Can I have any way to get the cloudstack agent to get the correct IP
>> address?
>> >
>> >
>> >
>> > Cloudstack 4.11.2
>> > CentOS 7.5
>> >
>> >
>> >
>> > br2:  mtu 1500 qdisc noqueue state UP
>> group
>> > default qlen 1000
>> >link/ether ac:1f:6b:ba:96:ea brd ff:ff:ff:ff:ff:ff
>> >inet 10.226.16.11/24 brd 10.226.16.255 scope global noprefixroute br2
>> >   valid_lft forever preferred_lft forever
>> >inet 10.226.16.10/24 scope global secondary br2
>> >   valid_lft forever preferred_lft forever
>> >inet6 fe80::1456:f9ff:fe06:6228/64 scope link
>> >valid_lft forever preferred_lft forever