Re: Auto Generating MAC Addresses for VMs in a given pattern

2017-05-11 Thread Sergey Levitskiy
Randomization is done for each VM. The only static part is prefix - 06. Unless 
you change the ACS code it won’t support a predefined range for Mac addresses. 
If you sort you nics table by IP address you will see that octet on the rigtht 
gets incremented due to respective sequence increment. But at the same time 
second and third octet on the left change due to randomization.

On 5/11/17, 10:44 AM, "Imran Ahmed"  wrote:

Hi Sergey,

I am grateful for your prompt reply. The data center provider has provided 
a starting sequence to be used. Do you think it would be another option to 
modify the sequence in db tables (data_center and user_ip_address) so that the 
VMs get an IP/MAC from that sequence? Is  the randomization function called 
during creation of each VM  or its run just once during the creation of zone 
(data_center)?

Kind regards,

Imran 

-Original Message-
From: Sergey Levitskiy [mailto:sergey.levits...@autodesk.com] 
Sent: Thursday, May 11, 2017 10:16 PM
To: users@cloudstack.apache.org
Subject: Re: Auto Generating MAC Addresses for VMs in a given pattern

Mac address is dynamically created based on the IP address sequence number 
being allocated on your subnet with randomization algorithm.
It is done in NetUtils.java 

public static long createSequenceBasedMacAddress(final long macAddress) 
{
return macAddress | 0x0600l | (long)s_rand.nextInt(32768) 
<< 25 & 0x00fffe00l;
}

Starting sequence of your address is defined in data_center table and 
carried over to user_ip_address tablewhere it gets properly incremented.

Routers use slightly different pattern for mac addresses.

I would advise to figure out another way of addressing your issue vs 
modifying ACS code that deals with MACs.

Thanks,
Sergey




On 5/11/17, 9:27 AM, "Imran Ahmed"  wrote:

Dear Team,
We are in a situation where the datacenter provider has put a 
restriction on
the MAC addresses.
We Cloudstack 4.3 with XenServers 6.5 .  We need to modify the pattern 
in
which the guest VMs get the MAC address and use the pattern provided by 
the
datacenter provider.
Please suggest what should be a good starting point ?

Best regards,

Imran 








RE: Auto Generating MAC Addresses for VMs in a given pattern

2017-05-11 Thread Imran Ahmed
Hi Sergey,

I am grateful for your prompt reply. The data center provider has provided a 
starting sequence to be used. Do you think it would be another option to modify 
the sequence in db tables (data_center and user_ip_address) so that the VMs get 
an IP/MAC from that sequence? Is  the randomization function called during 
creation of each VM  or its run just once during the creation of zone 
(data_center)?

Kind regards,

Imran 

-Original Message-
From: Sergey Levitskiy [mailto:sergey.levits...@autodesk.com] 
Sent: Thursday, May 11, 2017 10:16 PM
To: users@cloudstack.apache.org
Subject: Re: Auto Generating MAC Addresses for VMs in a given pattern

Mac address is dynamically created based on the IP address sequence number 
being allocated on your subnet with randomization algorithm.
It is done in NetUtils.java 

public static long createSequenceBasedMacAddress(final long macAddress) {
return macAddress | 0x0600l | (long)s_rand.nextInt(32768) << 25 
& 0x00fffe00l;
}

Starting sequence of your address is defined in data_center table and carried 
over to user_ip_address tablewhere it gets properly incremented.

Routers use slightly different pattern for mac addresses.

I would advise to figure out another way of addressing your issue vs modifying 
ACS code that deals with MACs.

Thanks,
Sergey




On 5/11/17, 9:27 AM, "Imran Ahmed"  wrote:

Dear Team,
We are in a situation where the datacenter provider has put a restriction on
the MAC addresses.
We Cloudstack 4.3 with XenServers 6.5 .  We need to modify the pattern in
which the guest VMs get the MAC address and use the pattern provided by the
datacenter provider.
Please suggest what should be a good starting point ?

Best regards,

Imran 






Re: Auto Generating MAC Addresses for VMs in a given pattern

2017-05-11 Thread Sergey Levitskiy
Mac address is dynamically created based on the IP address sequence number 
being allocated on your subnet with randomization algorithm.
It is done in NetUtils.java 

public static long createSequenceBasedMacAddress(final long macAddress) {
return macAddress | 0x0600l | (long)s_rand.nextInt(32768) << 25 
& 0x00fffe00l;
}

Starting sequence of your address is defined in data_center table and carried 
over to user_ip_address tablewhere it gets properly incremented.

Routers use slightly different pattern for mac addresses.

I would advise to figure out another way of addressing your issue vs modifying 
ACS code that deals with MACs.

Thanks,
Sergey




On 5/11/17, 9:27 AM, "Imran Ahmed"  wrote:

Dear Team,
We are in a situation where the datacenter provider has put a restriction on
the MAC addresses.
We Cloudstack 4.3 with XenServers 6.5 .  We need to modify the pattern in
which the guest VMs get the MAC address and use the pattern provided by the
datacenter provider.
Please suggest what should be a good starting point ?

Best regards,

Imran 





Auto Generating MAC Addresses for VMs in a given pattern

2017-05-11 Thread Imran Ahmed
Dear Team,
We are in a situation where the datacenter provider has put a restriction on
the MAC addresses.
We Cloudstack 4.3 with XenServers 6.5 .  We need to modify the pattern in
which the guest VMs get the MAC address and use the pattern provided by the
datacenter provider.
Please suggest what should be a good starting point ?

Best regards,

Imran 



LXC support (the System VM template)

2017-05-11 Thread Vladimir Melnik
Dear colleagues,

I have a couple of questions regarding LXC support if anyone doesn't mind. The 
first question seems to be really simple, but I'd like to make sure that I'm on 
the right way.

I've added an LXC-zone to the ACS setup where I already have a KVM-zone. OK. 
I've added a host, but now I can't find the System VM template installed. I see 
this template in the list of templates and it even said that its' download is 
completed 
(https://www.dropbox.com/s/pm03jcuvipxtnmk/Screenshot%202017-05-11%2014.47.41.png?dl=0),
 but there are no files in my secondary storage which I've set up for the new 
zone. The directory is empty, so, when I'm enabling the zone, the 
cloudstack-agent's log shows the following:
--- 8< ---
2017-05-10 22:53:05,857 INFO  [kvm.storage.LibvirtStorageAdaptor] 
(agentRequest-Handler-3:null) (logid:c98f90c7) Attempting to create storage poo
l 974cb6d1-7064-3a53-9d37-698037e367d0 (NetworkFilesystem) in libvirt
2017-05-10 22:53:05,858 WARN  [kvm.storage.LibvirtStorageAdaptor] 
(agentRequest-Handler-3:null) (logid:c98f90c7) Storage pool 974cb6d1-7064-3a53-
9d37-698037e367d0 was not found running in libvirt. Need to create it.
2017-05-10 22:53:05,859 INFO  [kvm.storage.LibvirtStorageAdaptor] 
(agentRequest-Handler-3:null) (logid:c98f90c7) Didn't find an existing storage
pool 974cb6d1-7064-3a53-9d37-698037e367d0 by UUID, checking for pools with 
duplicate paths
2017-05-10 22:53:05,891 ERROR [kvm.storage.LibvirtStorageAdaptor] 
(agentRequest-Handler-3:null) (logid:c98f90c7) org.libvirt.LibvirtException: in
ternal error Child process (/bin/mount 
172.22.39.224:/export/secondary3/template/tmpl/1/10 
/mnt/974cb6d1-7064-3a53-9d37-698037e367d0) unexpected
exit status 32: mount.nfs: mounting 
172.22.39.224:/export/secondary3/template/tmpl/1/10 failed, reason given by 
server: No such file or directory

2017-05-10 22:53:05,892 ERROR [kvm.storage.LibvirtStorageAdaptor] 
(agentRequest-Handler-3:null) (logid:c98f90c7) Internal error occurred when att
empting to mount: specified path may be invalid
2017-05-10 22:53:05,892 ERROR [kvm.storage.LibvirtStorageAdaptor] 
(agentRequest-Handler-3:null) (logid:c98f90c7) Failed to create netfs mount: 17
2.22.39.224:/export/secondary3/template/tmpl/1/10
org.libvirt.LibvirtException: internal error Child process (/bin/mount 
172.22.39.224:/export/secondary3/template/tmpl/1/10 
/mnt/974cb6d1-7064-3a53-9d37-698037e367d0) unexpected exit status 32: 
mount.nfs: mounting 172.22.39.224:/export/secondary3/template/tmpl/1/10 failed, 
reason given by server: No such file or directory
--- >8 ---

In the same time I see the following records in the database:
--- 8< ---
mysql> SELECT * FROM vm_template WHERE id = 10;
++-+-+--++--++-+--+--++-+-++--+-+-+---+-+--+-+-+-+-++--+--+--++--+-+--+
| id | unique_name | name| uuid 
| public | featured | type   | hvm | bits | url 
 | format | created 
| removed | account_id | checksum | display_text
| enable_password | enable_sshkey | guest_os_id | bootable | prepopulate | 
cross_zones | extractable | hypervisor_type | source_template_id | template_tag 
| sort_key | size | state  | update_count | updated | dynamically_scalable |
++-+-+--++--++-+--+--++-+-++--+-+-+---+-+--+-+-+-+-++--+--+--++--+-+--+
| 10 | routing-10  | SystemVM Template (LXC) | 
a15d620e-bd31-11e6-b74f-06973a00088a |  0 |0 | SYSTEM |   0 |   64 
| 
http://cloudstack.apt-get.eu/systemvm/4.6/systemvm64template-4.6.0-kvm.qcow2.bz2
 | QCOW2  | 2016-12-08 12:32:33 | NULL|  1 | 
c059b0d051e0cd6fbe9d5d4fc40c7e5d | SystemVM Template (LXC) |   0 |  
   0 |  15 |1 |   0 |   1 |   0 
| LXC |   NULL | NULL |0 | NULL | 
Active |0 | NULL|0 |

Force delete template.

2017-05-11 Thread Ciobanu Cristian
Hello,

 

 What is the best way to force delete a template ? for some reasons is
one of the template is stuck, I'm not able to use not able to remove from
ACS side, this issue has occurred after migrated my NFS storage.

 

Regards,

Cristian