RE: Change of guest IP address

2014-02-20 Thread Geoff Higginbottom
Ian,

Had a quick look at your script and I like your approach however I guess this 
only works for Basic Zones as guest IP addresses are not unique in Isolated 
Networks.  You would need to enhance it with Network IDs to work with Isolated 
networks.

Regards

Geoff Higginbottom

D: +44 20 3603 0542 | S: +44 20 3603 0540 | M: +447968161581

geoff.higginbot...@shapeblue.com

-Original Message-
From: Ian Young [mailto:i...@duffrecords.com]
Sent: 20 February 2014 00:09
To: users@cloudstack.apache.org
Subject: Re: Change of guest IP address

> > On 19-Dec-2013, at 3:58 PM, Andrei Mikhailovsky  wrote:
> >
> > Do you know if there is an easier way? Like via the api calls or
> > the
cloudmonkey command? Or is it currently
> the only way?
> >
> > - Original Message -
> > From: "Jayapal Reddy Uradi"  To:
> "
> "  Sent: Thursday, 19 December, 2013
> 9:25:05 AM
> > Subject: Re: Change of guest IP address
> >
> > Hi,
> >
> > If your VM is in isolated network please do the following
> >
> > 1. edit the nics table ip4_address column for your instance_id
> > to
new ip.
> > 2. login to the router corresponds to the network and replace
> > old ip
with new ip in below files.
> >
> > a.  /var/lib/misc/dnsmasq.leases
> >   b.  /etc/dhcphosts.txt
> > 3. restart the dnsmasq in router (service dnsmasq restart) 4. Reboot
> > the VM or restart the network service in Vm so that VM gets the
> > new
ip from the dhcp.
> >
> > Thanks,
> > Jayapal

I put Jayapal's solution into a script for convenience:

http://pastebin.com/7yJtjNQX

Just edit the first group of variables according to your needs and run it like 
this:

set-vm-ip.sh old-address new-address

Need Enterprise Grade Support for Apache CloudStack?
Our CloudStack Infrastructure 
Support<http://shapeblue.com/cloudstack-infrastructure-support/> offers the 
best 24/7 SLA for CloudStack Environments.

Apache CloudStack Bootcamp training courses

**NEW!** CloudStack 4.2.1 training<http://shapeblue.com/cloudstack-training/>
18th-19th February 2014, Brazil. 
Classroom<http://shapeblue.com/cloudstack-training/>
17th-23rd March 2014, Region A. Instructor led, 
On-line<http://shapeblue.com/cloudstack-training/>
24th-28th March 2014, Region B. Instructor led, 
On-line<http://shapeblue.com/cloudstack-training/>
16th-20th June 2014, Region A. Instructor led, 
On-line<http://shapeblue.com/cloudstack-training/>
23rd-27th June 2014, Region B. Instructor led, 
On-line<http://shapeblue.com/cloudstack-training/>

This email and any attachments to it may be confidential and are intended 
solely for the use of the individual to whom it is addressed. Any views or 
opinions expressed are solely those of the author and do not necessarily 
represent those of Shape Blue Ltd or related companies. If you are not the 
intended recipient of this email, you must neither take any action based upon 
its contents, nor copy or show it to anyone. Please contact the sender if you 
believe you have received this email in error. Shape Blue Ltd is a company 
incorporated in England & Wales. ShapeBlue Services India LLP is a company 
incorporated in India and is operated under license from Shape Blue Ltd. Shape 
Blue Brasil Consultoria Ltda is a company incorporated in Brasil and is 
operated under license from Shape Blue Ltd. ShapeBlue is a registered trademark.


Re: Change of guest IP address

2014-02-19 Thread Ian Young
> > On 19-Dec-2013, at 3:58 PM, Andrei Mikhailovsky  wrote:
> >
> > Do you know if there is an easier way? Like via the api calls or the 
cloudmonkey command? Or is it currently
> the only way?
> >
> > - Original Message -
> > From: "Jayapal Reddy Uradi"  To:
> " 
> "  Sent: Thursday, 19 December, 2013
> 9:25:05 AM
> > Subject: Re: Change of guest IP address
> >
> > Hi,
> >
> > If your VM is in isolated network please do the following
> >
> > 1. edit the nics table ip4_address column for your instance_id to 
new ip.
> > 2. login to the router corresponds to the network and replace old ip 
with new ip in below files.
> >
> > a.  /var/lib/misc/dnsmasq.leases
> >   b.  /etc/dhcphosts.txt
> > 3. restart the dnsmasq in router (service dnsmasq restart) 4. Reboot
> > the VM or restart the network service in Vm so that VM gets the new 
ip from the dhcp.
> >
> > Thanks,
> > Jayapal

I put Jayapal's solution into a script for convenience:

http://pastebin.com/7yJtjNQX

Just edit the first group of variables according to your needs and run it 
like this:

set-vm-ip.sh old-address new-address



Re: Change of guest IP address

2013-12-19 Thread Andrei Mikhailovsky
Demenico,I've followed your suggestion but had some difficulties:
2) Change network_id in vm_instance mysql table to a guest
network with associated a DHCP service.Table vm_instance doesn't have the column network_idAlso, when trying to follow step 4 i have the following error:mysql>  update user_ip_address set account_id='NULL' where id=92;ERROR 1452 (23000): Cannot add or update a child row: a foreign key constraint fails (`cloud`.`user_ip_address`, CONSTRAINT `fk_user_ip_address__account_id` FOREIGN KEY (`account_id`) REFERENCES `account` (`id`))Any suggestions?ThanksAndreiFrom: "Domenico De Monte" To: users@cloudstack.apache.orgSent: Thursday, 19 December, 2013 4:46:19 PMSubject: Re: Change of guest IP address
  

  
We try to fix like this:

1) Destroy vm with NIC collected to QuickCloudNoService. Of
course we will see expunging errors.
2) Change network_id in vm_instance mysql table to a guest
network with associated a DHCP service.
3) Let CS destroy vm instance.
4) Update user_ip_address mysql table with following values
based on IP address assigned to that vm:

- state='Free'
- account_id=NULL
- domain_id=NULL

Before doing this, we destroy a vm with a single NIC connected
to a NetworkOffering with DHCP and we notice that just those 2
tables (vm_instance and user_ip_address ) where updated and were
important for this operation ( also other tables likes
async_job, async_job_view, nics, usage_event but i do not think
they are important for this operation from what i can see and
suppose ).


Regards


Il 19/12/2013 17:17, Andrei
  Mikhailovsky ha scritto:


  Ah, I see, so I am not going mad, it is actually a known issue ))

Anyway, I should probably wait for 4.3 to be out as 4.2.1 is still utterly broken when it comes to S3 Secondary storage which is what i am after.

Andrei

- Original Message -
From: "Andrija Panic" 
To: users@cloudstack.apache.org
Sent: Thursday, 19 December, 2013 3:24:19 PM
Subject: Re: Change of guest IP address


My "workarround" is to wait for 4.2.1, and have bunch of VMs that can not be deleted, just waisting my disk space... 
And yes, that is true, the logs you sent, I have that very issue. 
Bug here: https://issues.apache.org/jira/browse/CLOUDSTACK-4828 


Andrija 



On 19 December 2013 16:14, Domenico De Monte < d.demo...@netsons.com > wrote: 



So if i understand correctly: 

if we create a vm with offering network WITHOUT dhcp ( like QuickCloudNoService ) and we want terminate it, we can not because there is a bug that NEED to remove dhcp service from virtual nic assigned to this network. 

If it's case, following log show exact error? 

2013-12-19 16:08:01,332 DEBUG [cloud.vm.VirtualMachineManagerImpl] (UserVm-Scavenger-1:null) Stopped called on VM[User|Test01] but the state is Expunging 
2013-12-19 16:08:01,339 DEBUG [cloud.capacity.CapacityManagerImpl] (UserVm-Scavenger-1:null) VM state transitted from :Expunging to Expunging with event: ExpungeOperationvm's original host id: null new host id: null host id before state transition: null 
2013-12-19 16:08:01,339 DEBUG [cloud.vm.VirtualMachineManagerImpl] (UserVm-Scavenger-1:null) Destroying vm VM[User|Test01] 
2013-12-19 16:08:01,339 DEBUG [cloud.vm.VirtualMachineManagerImpl] (UserVm-Scavenger-1:null) Cleaning up NICS 
2013-12-19 16:08:01,341 DEBUG [cloud.network.NetworkManagerImpl] (UserVm-Scavenger-1:null) Cleaning network for vm: 8 
2013-12-19 16:08:01,346 DEBUG [cloud.network.NetworkModelImpl] (UserVm-Scavenger-1:null) Service SecurityGroup is not supported in the network id=207 
2013-12-19 16:08:01,349 WARN [cloud.vm.UserVmManagerImpl] (UserVm-Scavenger-1:null) Unable to expunge VM[User|Test01] 
com.cloud.exception.UnsupportedServiceException: Service Dhcp is not supported in the network id=207 
at com.cloud.network.dao.NetworkServiceMapDaoImpl.getProviderForServiceInNetwork(NetworkServiceMapDaoImpl.java:127) 
at com.cloud.utils.component.ComponentInstantiationPostProcessor$InterceptorDispatcher.intercept(ComponentInstantiationPostProcessor.java:125) 
at com.cloud.network.NetworkManagerImpl.getDhcpServiceProvider(NetworkManagerImpl.java:3681) 
at com.cloud.network.NetworkManagerImpl.isDhcpAccrossMultipleSubnetsSupported(NetworkManagerImpl.java:2522) 
at com.cloud.network.NetworkManagerImpl.removeNic(NetworkManagerImpl.java:2507) 
at com.cloud.network.NetworkManagerImpl.cleanupNics(NetworkManagerImpl.java:2463) 
at com.cloud.vm.VirtualMachineManagerImpl.advanceExpunge(VirtualMachineManagerImpl.java:475) 
at com.cloud.vm.UserVmManagerImpl.expunge(UserVmManagerImpl.java:1600) 
at com.cloud.vm.UserVmManagerImpl$ExpungeTask.run(UserVmManagerImpl.java:1769) 
at java.util.concurrent.Executo

Re: Change of guest IP address

2013-12-19 Thread Domenico De Monte

  
  
We try to fix like this:

1) Destroy vm with NIC collected to QuickCloudNoService. Of
course we will see expunging errors.
2) Change network_id in vm_instance mysql table to a guest
network with associated a DHCP service.
3) Let CS destroy vm instance.
4) Update user_ip_address mysql table with following values
based on IP address assigned to that vm:

- state='Free'
- account_id=NULL
- domain_id=NULL

Before doing this, we destroy a vm with a single NIC connected
to a NetworkOffering with DHCP and we notice that just those 2
tables (vm_instance and user_ip_address ) where updated and were
important for this operation ( also other tables likes
async_job, async_job_view, nics, usage_event but i do not think
they are important for this operation from what i can see and
suppose ).


Regards


Il 19/12/2013 17:17, Andrei
  Mikhailovsky ha scritto:


  Ah, I see, so I am not going mad, it is actually a known issue ))

Anyway, I should probably wait for 4.3 to be out as 4.2.1 is still utterly broken when it comes to S3 Secondary storage which is what i am after.

Andrei

- Original Message -
From: "Andrija Panic" 
To: users@cloudstack.apache.org
Sent: Thursday, 19 December, 2013 3:24:19 PM
Subject: Re: Change of guest IP address


My "workarround" is to wait for 4.2.1, and have bunch of VMs that can not be deleted, just waisting my disk space... 
And yes, that is true, the logs you sent, I have that very issue. 
Bug here: https://issues.apache.org/jira/browse/CLOUDSTACK-4828 


Andrija 



On 19 December 2013 16:14, Domenico De Monte < d.demo...@netsons.com > wrote: 



So if i understand correctly: 

if we create a vm with offering network WITHOUT dhcp ( like QuickCloudNoService ) and we want terminate it, we can not because there is a bug that NEED to remove dhcp service from virtual nic assigned to this network. 

If it's case, following log show exact error? 

2013-12-19 16:08:01,332 DEBUG [cloud.vm.VirtualMachineManagerImpl] (UserVm-Scavenger-1:null) Stopped called on VM[User|Test01] but the state is Expunging 
2013-12-19 16:08:01,339 DEBUG [cloud.capacity.CapacityManagerImpl] (UserVm-Scavenger-1:null) VM state transitted from :Expunging to Expunging with event: ExpungeOperationvm's original host id: null new host id: null host id before state transition: null 
2013-12-19 16:08:01,339 DEBUG [cloud.vm.VirtualMachineManagerImpl] (UserVm-Scavenger-1:null) Destroying vm VM[User|Test01] 
2013-12-19 16:08:01,339 DEBUG [cloud.vm.VirtualMachineManagerImpl] (UserVm-Scavenger-1:null) Cleaning up NICS 
2013-12-19 16:08:01,341 DEBUG [cloud.network.NetworkManagerImpl] (UserVm-Scavenger-1:null) Cleaning network for vm: 8 
2013-12-19 16:08:01,346 DEBUG [cloud.network.NetworkModelImpl] (UserVm-Scavenger-1:null) Service SecurityGroup is not supported in the network id=207 
2013-12-19 16:08:01,349 WARN [cloud.vm.UserVmManagerImpl] (UserVm-Scavenger-1:null) Unable to expunge VM[User|Test01] 
com.cloud.exception.UnsupportedServiceException: Service Dhcp is not supported in the network id=207 
at com.cloud.network.dao.NetworkServiceMapDaoImpl.getProviderForServiceInNetwork(NetworkServiceMapDaoImpl.java:127) 
at com.cloud.utils.component.ComponentInstantiationPostProcessor$InterceptorDispatcher.intercept(ComponentInstantiationPostProcessor.java:125) 
at com.cloud.network.NetworkManagerImpl.getDhcpServiceProvider(NetworkManagerImpl.java:3681) 
at com.cloud.network.NetworkManagerImpl.isDhcpAccrossMultipleSubnetsSupported(NetworkManagerImpl.java:2522) 
at com.cloud.network.NetworkManagerImpl.removeNic(NetworkManagerImpl.java:2507) 
at com.cloud.network.NetworkManagerImpl.cleanupNics(NetworkManagerImpl.java:2463) 
at com.cloud.vm.VirtualMachineManagerImpl.advanceExpunge(VirtualMachineManagerImpl.java:475) 
at com.cloud.vm.UserVmManagerImpl.expunge(UserVmManagerImpl.java:1600) 
at com.cloud.vm.UserVmManagerImpl$ExpungeTask.run(UserVmManagerImpl.java:1769) 
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) 
at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:351) 
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:178) 
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:165) 
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:267) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 
at java.lang.Thread.run(Thread.java:701) 


Which is a possible solution or workaround for this bug ? 


Waiting for your reply 

Regards 


Il 19/12/2013 15:40, Andrija Panic ha scritto:

Re: Change of guest IP address

2013-12-19 Thread Andrei Mikhailovsky
Ah, I see, so I am not going mad, it is actually a known issue ))

Anyway, I should probably wait for 4.3 to be out as 4.2.1 is still utterly 
broken when it comes to S3 Secondary storage which is what i am after.

Andrei

- Original Message -
From: "Andrija Panic" 
To: users@cloudstack.apache.org
Sent: Thursday, 19 December, 2013 3:24:19 PM
Subject: Re: Change of guest IP address


My "workarround" is to wait for 4.2.1, and have bunch of VMs that can not be 
deleted, just waisting my disk space... 
And yes, that is true, the logs you sent, I have that very issue. 
Bug here: https://issues.apache.org/jira/browse/CLOUDSTACK-4828 


Andrija 



On 19 December 2013 16:14, Domenico De Monte < d.demo...@netsons.com > wrote: 



So if i understand correctly: 

if we create a vm with offering network WITHOUT dhcp ( like QuickCloudNoService 
) and we want terminate it, we can not because there is a bug that NEED to 
remove dhcp service from virtual nic assigned to this network. 

If it's case, following log show exact error? 

2013-12-19 16:08:01,332 DEBUG [cloud.vm.VirtualMachineManagerImpl] 
(UserVm-Scavenger-1:null) Stopped called on VM[User|Test01] but the state is 
Expunging 
2013-12-19 16:08:01,339 DEBUG [cloud.capacity.CapacityManagerImpl] 
(UserVm-Scavenger-1:null) VM state transitted from :Expunging to Expunging with 
event: ExpungeOperationvm's original host id: null new host id: null host id 
before state transition: null 
2013-12-19 16:08:01,339 DEBUG [cloud.vm.VirtualMachineManagerImpl] 
(UserVm-Scavenger-1:null) Destroying vm VM[User|Test01] 
2013-12-19 16:08:01,339 DEBUG [cloud.vm.VirtualMachineManagerImpl] 
(UserVm-Scavenger-1:null) Cleaning up NICS 
2013-12-19 16:08:01,341 DEBUG [cloud.network.NetworkManagerImpl] 
(UserVm-Scavenger-1:null) Cleaning network for vm: 8 
2013-12-19 16:08:01,346 DEBUG [cloud.network.NetworkModelImpl] 
(UserVm-Scavenger-1:null) Service SecurityGroup is not supported in the network 
id=207 
2013-12-19 16:08:01,349 WARN [cloud.vm.UserVmManagerImpl] 
(UserVm-Scavenger-1:null) Unable to expunge VM[User|Test01] 
com.cloud.exception.UnsupportedServiceException: Service Dhcp is not supported 
in the network id=207 
at 
com.cloud.network.dao.NetworkServiceMapDaoImpl.getProviderForServiceInNetwork(NetworkServiceMapDaoImpl.java:127)
 
at 
com.cloud.utils.component.ComponentInstantiationPostProcessor$InterceptorDispatcher.intercept(ComponentInstantiationPostProcessor.java:125)
 
at 
com.cloud.network.NetworkManagerImpl.getDhcpServiceProvider(NetworkManagerImpl.java:3681)
 
at 
com.cloud.network.NetworkManagerImpl.isDhcpAccrossMultipleSubnetsSupported(NetworkManagerImpl.java:2522)
 
at com.cloud.network.NetworkManagerImpl.removeNic(NetworkManagerImpl.java:2507) 
at 
com.cloud.network.NetworkManagerImpl.cleanupNics(NetworkManagerImpl.java:2463) 
at 
com.cloud.vm.VirtualMachineManagerImpl.advanceExpunge(VirtualMachineManagerImpl.java:475)
 
at com.cloud.vm.UserVmManagerImpl.expunge(UserVmManagerImpl.java:1600) 
at com.cloud.vm.UserVmManagerImpl$ExpungeTask.run(UserVmManagerImpl.java:1769) 
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) 
at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:351) 
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:178) 
at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:165)
 
at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:267)
 
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146) 
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 
at java.lang.Thread.run(Thread.java:701) 


Which is a possible solution or workaround for this bug ? 


Waiting for your reply 

Regards 


Il 19/12/2013 15:40, Andrija Panic ha scritto: 




Due to the bug, you are unable to remove netowrk from VM, if that network's
network offering does not have DHCP as the service.
And you will not be possible to delete such VMs, that are connected to the
netowrk without DHCP service in it's offering.

This is 4.2 bug...


On 19 December 2013 15:36, Andrei Mikhailovsky  wrote: 

Geoff,

Thanks for your reply. This is the first route i tried to take, but it
didn't work for me. When I tried to remove the NIC from the guest i had an
error message complaining that the network offering does not have dhcp
service or something like that. I did not take a note of the actual
message. This was after i've changed the default NIC to a temporary nic.
The NIC that I have is from a service offering called QuickCloudNoService.
I guess it's a bug...

I will try the db route and see if it works.

Thanks for your help guys

Andrei



- Original Message -
From: "Geoff Higginbottom"  To: 
users@cloudstack.apache.org Sent: Thursday, 19 December, 2013 12:19:40

Re: Change of guest IP address

2013-12-19 Thread Andrei Mikhailovsky
Geoff, that's right, there is not dhcp service, as the error message has 
suggested. However, when I've added the network with the offering 
QuickCloudNoService it has assigned a random IP address from the public IP 
range that I've specified. It hasn't assigned it through dhcp. I think it 
picked a random one from the range and put it in the database. It is a direct 
route without any VRs in the way. So, if CS assigned the IP address, there has 
to be a way to 1) change the IP address, 2) release the IP address and 3) 
remove the NIC with that service offering. I can't do any of the above at the 
moment without messing around with the database directly. This I think is a bug.

Andrei


- Original Message -
From: "Geoff Higginbottom" 
To: users@cloudstack.apache.org
Sent: Thursday, 19 December, 2013 2:40:29 PM
Subject: RE: Change of guest IP address

Andrei,

The QuickCloudNoService Network Offering provides no DHCP, or any other 
services (clues in the name) so it's not really a bug as the add / remove NIC 
features require DHCP to be enabled on the Network.

I have tested this procedure using the default 
'DefaultIsolatedNetworkOfferingWithSourceNatService' network offering and it 
works like a charm

Regards

Geoff Higginbottom

D: +44 20 3603 0542 | S: +44 20 3603 0540 | M: +447968161581

geoff.higginbot...@shapeblue.com

-Original Message-
From: Andrei Mikhailovsky [mailto:and...@arhont.com]
Sent: 19 December 2013 14:36
To: users@cloudstack.apache.org
Subject: Re: Change of guest IP address

Geoff,

Thanks for your reply. This is the first route i tried to take, but it didn't 
work for me. When I tried to remove the NIC from the guest i had an error 
message complaining that the network offering does not have dhcp service or 
something like that. I did not take a note of the actual message. This was 
after i've changed the default NIC to a temporary nic. The NIC that I have is 
from a service offering called QuickCloudNoService. I guess it's a bug...

I will try the db route and see if it works.

Thanks for your help guys

Andrei



- Original Message -
From: "Geoff Higginbottom" 
To: users@cloudstack.apache.org
Sent: Thursday, 19 December, 2013 12:19:40 PM
Subject: RE: Change of guest IP address

Andrei,

You could use the addNicToVirtualMachine API command (assuming you are running 
4.1 or 4.2)

1. Assign the VM a new 'temp' NIC on an alternate network 2. Set this new NIC 
to default 3. Remove original NIC 4. Assign a NIC on the original Network, but 
also set the required IP (hence using API and not UI) 5. Set this new NIC to 
default 6. Remove the temp NIC

API commands required are

addNicToVirtualMachine 
http://cloudstack.apache.org/docs/api/apidocs-4.2/root_admin/addNicToVirtualMachine.html

updateDefaultNicForVirtualMachine 
http://cloudstack.apache.org/docs/api/apidocs-4.2/root_admin/updateDefaultNicForVirtualMachine.html

removeNicFromVirtualMachine 
http://cloudstack.apache.org/docs/api/apidocs-4.2/root_admin/removeNicFromVirtualMachine.html

Whilst there are 6 steps, a simple CloudMonkey Script could complete this 
process in around 30 secs

Regards

Geoff Higginbottom

D: +44 20 3603 0542 | S: +44 20 3603 0540 | M: +447968161581

geoff.higginbot...@shapeblue.com

-Original Message-
From: Jayapal Reddy Uradi [mailto:jayapalreddy.ur...@citrix.com]
Sent: 19 December 2013 11:27
To: 
Subject: Re: Change of guest IP address

Hi,

There is no other way to change the ip.
If you want specific IP for the VM, you can get secondary ip  in vm NICs page 
and configure it on the VM.

Thanks,
Jayapal


On 19-Dec-2013, at 3:58 PM, Andrei Mikhailovsky  wrote:

> Do you know if there is an easier way? Like via the api calls or the 
> cloudmonkey command? Or is it currently the only way?
>
>
> - Original Message -
> From: "Jayapal Reddy Uradi" 
> To: "" 
> Sent: Thursday, 19 December, 2013 9:25:05 AM
> Subject: Re: Change of guest IP address
>
> Hi,
>
> If your VM is in isolated network please do the following
>
> 1. edit the nics table ip4_address column for your instance_id to new ip.
> 2. login to the router corresponds to the network and replace old ip with new 
> ip in below files.
>  a.  /var/lib/misc/dnsmasq.leases
>  b.  /etc/dhcphosts.txt
> 3. restart the dnsmasq in router (service dnsmasq restart) 4. Reboot
> the VM or restart the network service in Vm so that VM gets the new ip from 
> the dhcp.
>
> Thanks,
> Jayapal
>
> On 19-Dec-2013, at 2:27 PM, Andrei Mikhailovsky 
> wrote:
>
>> Hello guys,
>>
>> Could some one tell me how to change the IP address of a guest vm? It has 
>> been assigned by default by dhcp router and I would like to change it. I 
>> know how to create a new vm with a specified IP address using cloudmonkey, 
>> bu

Re: Change of guest IP address

2013-12-19 Thread Andrija Panic
My "workarround" is to wait for 4.2.1, and have bunch of VMs that can not
be deleted, just waisting my disk space...
And yes, that is true, the logs you sent, I have that very issue.
Bug here: https://issues.apache.org/jira/browse/CLOUDSTACK-4828

Andrija


On 19 December 2013 16:14, Domenico De Monte  wrote:

>  So if i understand correctly:
>
> if we create a vm with offering network WITHOUT dhcp ( like
> QuickCloudNoService ) and we want terminate it, we can not because there is
> a bug that NEED to remove dhcp service from virtual nic assigned to this
> network.
>
> If it's case, following log show exact error?
>
> 2013-12-19 16:08:01,332 DEBUG [cloud.vm.VirtualMachineManagerImpl]
> (UserVm-Scavenger-1:null) Stopped called on VM[User|Test01] but the state
> is Expunging
> 2013-12-19 16:08:01,339 DEBUG [cloud.capacity.CapacityManagerImpl]
> (UserVm-Scavenger-1:null) VM state transitted from :Expunging to Expunging
> with event: ExpungeOperationvm's original host id: null new host id: null
> host id before state transition: null
> 2013-12-19 16:08:01,339 DEBUG [cloud.vm.VirtualMachineManagerImpl]
> (UserVm-Scavenger-1:null) Destroying vm VM[User|Test01]
> 2013-12-19 16:08:01,339 DEBUG [cloud.vm.VirtualMachineManagerImpl]
> (UserVm-Scavenger-1:null) Cleaning up NICS
> 2013-12-19 16:08:01,341 DEBUG [cloud.network.NetworkManagerImpl]
> (UserVm-Scavenger-1:null) Cleaning network for vm: 8
> 2013-12-19 16:08:01,346 DEBUG [cloud.network.NetworkModelImpl]
> (UserVm-Scavenger-1:null) Service SecurityGroup is not supported in the
> network id=207
> 2013-12-19 16:08:01,349 WARN  [cloud.vm.UserVmManagerImpl]
> (UserVm-Scavenger-1:null) Unable to expunge VM[User|Test01]
> com.cloud.exception.UnsupportedServiceException: Service Dhcp is not
> supported in the network id=207
> at
> com.cloud.network.dao.NetworkServiceMapDaoImpl.getProviderForServiceInNetwork(NetworkServiceMapDaoImpl.java:127)
> at
> com.cloud.utils.component.ComponentInstantiationPostProcessor$InterceptorDispatcher.intercept(ComponentInstantiationPostProcessor.java:125)
> at
> com.cloud.network.NetworkManagerImpl.getDhcpServiceProvider(NetworkManagerImpl.java:3681)
> at
> com.cloud.network.NetworkManagerImpl.isDhcpAccrossMultipleSubnetsSupported(NetworkManagerImpl.java:2522)
> at
> com.cloud.network.NetworkManagerImpl.removeNic(NetworkManagerImpl.java:2507)
> at
> com.cloud.network.NetworkManagerImpl.cleanupNics(NetworkManagerImpl.java:2463)
> at
> com.cloud.vm.VirtualMachineManagerImpl.advanceExpunge(VirtualMachineManagerImpl.java:475)
> at
> com.cloud.vm.UserVmManagerImpl.expunge(UserVmManagerImpl.java:1600)
> at
> com.cloud.vm.UserVmManagerImpl$ExpungeTask.run(UserVmManagerImpl.java:1769)
> at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
> at
> java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:351)
> at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:178)
> at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:165)
> at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:267)
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> at java.lang.Thread.run(Thread.java:701)
>
>
> Which is a possible solution or workaround for this bug ?
>
>
> Waiting for your reply
>
> Regards
>
>  Il 19/12/2013 15:40, Andrija Panic ha scritto:
>
> Due to the bug, you are unable to remove netowrk from VM, if that network's
> network offering does not have DHCP as the service.
> And you will not be possible to delete such VMs, that are connected to the
> netowrk without DHCP service in it's offering.
>
> This is 4.2 bug...
>
>
> On 19 December 2013 15:36, Andrei Mikhailovsky  
>  wrote:
>
>
>  Geoff,
>
> Thanks for your reply. This is the first route i tried to take, but it
> didn't work for me. When I tried to remove the NIC from the guest i had an
> error message complaining that the network offering does not have dhcp
> service or something like that. I did not take a note of the actual
> message. This was after i've changed the default NIC to a temporary nic.
> The NIC that I have is from a service offering called QuickCloudNoService.
> I guess it's a bug...
>
> I will try the db route and see if it works.
>
> Thanks for your help guys
>
> Andrei
>
>
>
> - Original Message -

Re: Change of guest IP address

2013-12-19 Thread Domenico De Monte

  
  
So if i understand correctly:

if we create a vm with offering network WITHOUT dhcp ( like
QuickCloudNoService ) and we want terminate it, we can not
because there is a bug that NEED to remove dhcp service from
virtual nic assigned to this network.

If it's case, following log show exact error?

2013-12-19 16:08:01,332 DEBUG
[cloud.vm.VirtualMachineManagerImpl] (UserVm-Scavenger-1:null)
Stopped called on VM[User|Test01] but the state is Expunging
2013-12-19 16:08:01,339 DEBUG
[cloud.capacity.CapacityManagerImpl] (UserVm-Scavenger-1:null)
VM state transitted from :Expunging to Expunging with event:
ExpungeOperationvm's original host id: null new host id: null
host id before state transition: null
2013-12-19 16:08:01,339 DEBUG
[cloud.vm.VirtualMachineManagerImpl] (UserVm-Scavenger-1:null)
Destroying vm VM[User|Test01]
2013-12-19 16:08:01,339 DEBUG
[cloud.vm.VirtualMachineManagerImpl] (UserVm-Scavenger-1:null)
Cleaning up NICS
2013-12-19 16:08:01,341 DEBUG [cloud.network.NetworkManagerImpl]
(UserVm-Scavenger-1:null) Cleaning network for vm: 8
2013-12-19 16:08:01,346 DEBUG [cloud.network.NetworkModelImpl]
(UserVm-Scavenger-1:null) Service SecurityGroup is not supported
in the network id=207
2013-12-19 16:08:01,349 WARN  [cloud.vm.UserVmManagerImpl]
(UserVm-Scavenger-1:null) Unable to expunge VM[User|Test01]
com.cloud.exception.UnsupportedServiceException: Service Dhcp is
not supported in the network id=207
    at
com.cloud.network.dao.NetworkServiceMapDaoImpl.getProviderForServiceInNetwork(NetworkServiceMapDaoImpl.java:127)
    at
com.cloud.utils.component.ComponentInstantiationPostProcessor$InterceptorDispatcher.intercept(ComponentInstantiationPostProcessor.java:125)
    at
com.cloud.network.NetworkManagerImpl.getDhcpServiceProvider(NetworkManagerImpl.java:3681)
    at
com.cloud.network.NetworkManagerImpl.isDhcpAccrossMultipleSubnetsSupported(NetworkManagerImpl.java:2522)
    at
com.cloud.network.NetworkManagerImpl.removeNic(NetworkManagerImpl.java:2507)
    at
com.cloud.network.NetworkManagerImpl.cleanupNics(NetworkManagerImpl.java:2463)
    at
com.cloud.vm.VirtualMachineManagerImpl.advanceExpunge(VirtualMachineManagerImpl.java:475)
    at
com.cloud.vm.UserVmManagerImpl.expunge(UserVmManagerImpl.java:1600)
    at
com.cloud.vm.UserVmManagerImpl$ExpungeTask.run(UserVmManagerImpl.java:1769)
    at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at
java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:351)
    at
java.util.concurrent.FutureTask.runAndReset(FutureTask.java:178)
    at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:165)
    at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:267)
    at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
    at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:701)


Which is a possible solution or workaround for this bug ?


Waiting for your reply

Regards

  
Il 19/12/2013 15:40, Andrija Panic ha
  scritto:


  Due to the bug, you are unable to remove netowrk from VM, if that network's
network offering does not have DHCP as the service.
And you will not be possible to delete such VMs, that are connected to the
netowrk without DHCP service in it's offering.

This is 4.2 bug...


On 19 December 2013 15:36, Andrei Mikhailovsky  wrote:


  
Geoff,

Thanks for your reply. This is the first route i tried to take, but it
didn't work for me. When I tried to remove the NIC from the guest i had an
error message complaining that the network offering does not have dhcp
service or something like that. I did not take a note of the actual
message. This was after i've changed the default NIC to a temporary nic.
The NIC that I have is from a service offering called QuickCloudNoService.
I guess it's a bug...

I will try the db route and see if it works.

Thanks for your help guys

Andrei



- Original Message -
From: "Geoff Higginbottom" 
To: users@cloudstack.apache.org
Sent: Thursday, 19 December, 2013 12:19:40 PM
Subject: RE: Change of guest IP address

Andrei,

You could use the addNicToVirtualMachine API command (assuming you are
running 4.1 or 4.2)

1. Assign the VM a new '

Re: Change of guest IP address

2013-12-19 Thread Andrija Panic
Due to the bug, you are unable to remove netowrk from VM, if that network's
network offering does not have DHCP as the service.
And you will not be possible to delete such VMs, that are connected to the
netowrk without DHCP service in it's offering.

This is 4.2 bug...


On 19 December 2013 15:36, Andrei Mikhailovsky  wrote:

> Geoff,
>
> Thanks for your reply. This is the first route i tried to take, but it
> didn't work for me. When I tried to remove the NIC from the guest i had an
> error message complaining that the network offering does not have dhcp
> service or something like that. I did not take a note of the actual
> message. This was after i've changed the default NIC to a temporary nic.
> The NIC that I have is from a service offering called QuickCloudNoService.
> I guess it's a bug...
>
> I will try the db route and see if it works.
>
> Thanks for your help guys
>
> Andrei
>
>
>
> - Original Message -
> From: "Geoff Higginbottom" 
> To: users@cloudstack.apache.org
> Sent: Thursday, 19 December, 2013 12:19:40 PM
> Subject: RE: Change of guest IP address
>
> Andrei,
>
> You could use the addNicToVirtualMachine API command (assuming you are
> running 4.1 or 4.2)
>
> 1. Assign the VM a new 'temp' NIC on an alternate network
> 2. Set this new NIC to default
> 3. Remove original NIC
> 4. Assign a NIC on the original Network, but also set the required IP
> (hence using API and not UI)
> 5. Set this new NIC to default
> 6. Remove the temp NIC
>
> API commands required are
>
> addNicToVirtualMachine
> http://cloudstack.apache.org/docs/api/apidocs-4.2/root_admin/addNicToVirtualMachine.html
>
> updateDefaultNicForVirtualMachine
> http://cloudstack.apache.org/docs/api/apidocs-4.2/root_admin/updateDefaultNicForVirtualMachine.html
>
> removeNicFromVirtualMachine
> http://cloudstack.apache.org/docs/api/apidocs-4.2/root_admin/removeNicFromVirtualMachine.html
>
> Whilst there are 6 steps, a simple CloudMonkey Script could complete this
> process in around 30 secs
>
> Regards
>
> Geoff Higginbottom
>
> D: +44 20 3603 0542 | S: +44 20 3603 0540 | M: +447968161581
>
> geoff.higginbot...@shapeblue.com
>
> -Original Message-
> From: Jayapal Reddy Uradi [mailto:jayapalreddy.ur...@citrix.com]
> Sent: 19 December 2013 11:27
> To: 
> Subject: Re: Change of guest IP address
>
> Hi,
>
> There is no other way to change the ip.
> If you want specific IP for the VM, you can get secondary ip  in vm NICs
> page and configure it on the VM.
>
> Thanks,
> Jayapal
>
>
> On 19-Dec-2013, at 3:58 PM, Andrei Mikhailovsky  wrote:
>
> > Do you know if there is an easier way? Like via the api calls or the
> cloudmonkey command? Or is it currently the only way?
> >
> >
> > - Original Message -
> > From: "Jayapal Reddy Uradi" 
> > To: "" 
> > Sent: Thursday, 19 December, 2013 9:25:05 AM
> > Subject: Re: Change of guest IP address
> >
> > Hi,
> >
> > If your VM is in isolated network please do the following
> >
> > 1. edit the nics table ip4_address column for your instance_id to new ip.
> > 2. login to the router corresponds to the network and replace old ip
> with new ip in below files.
> >  a.  /var/lib/misc/dnsmasq.leases
> >  b.  /etc/dhcphosts.txt
> > 3. restart the dnsmasq in router (service dnsmasq restart) 4. Reboot
> > the VM or restart the network service in Vm so that VM gets the new ip
> from the dhcp.
> >
> > Thanks,
> > Jayapal
> >
> > On 19-Dec-2013, at 2:27 PM, Andrei Mikhailovsky 
> > wrote:
> >
> >> Hello guys,
> >>
> >> Could some one tell me how to change the IP address of a guest vm? It
> has been assigned by default by dhcp router and I would like to change it.
> I know how to create a new vm with a specified IP address using
> cloudmonkey, but I couldn't find a way of changing the IP for the existing
> vm.
> >>
> >> Cheers
> >>
> >> Andrei
> >
>
> This email and any attachments to it may be confidential and are intended
> solely for the use of the individual to whom it is addressed. Any views or
> opinions expressed are solely those of the author and do not necessarily
> represent those of Shape Blue Ltd or related companies. If you are not the
> intended recipient of this email, you must neither take any action based
> upon its contents, nor copy or show it to anyone. Please contact the sender
> if you believe you have received this email in error. Shape Blue Ltd is a
> company incorporated in England & Wales. ShapeBlue Services India LLP is a
> company incorporated in India and is operated under license from Shape Blue
> Ltd. Shape Blue Brasil Consultoria Ltda is a company incorporated in Brasil
> and is operated under license from Shape Blue Ltd. ShapeBlue is a
> registered trademark.
>



-- 

Andrija Panić
--
  http://admintweets.com
--


RE: Change of guest IP address

2013-12-19 Thread Geoff Higginbottom
Andrei,

The QuickCloudNoService Network Offering provides no DHCP, or any other 
services (clues in the name) so it's not really a bug as the add / remove NIC 
features require DHCP to be enabled on the Network.

I have tested this procedure using the default 
'DefaultIsolatedNetworkOfferingWithSourceNatService' network offering and it 
works like a charm

Regards

Geoff Higginbottom

D: +44 20 3603 0542 | S: +44 20 3603 0540 | M: +447968161581

geoff.higginbot...@shapeblue.com

-Original Message-
From: Andrei Mikhailovsky [mailto:and...@arhont.com]
Sent: 19 December 2013 14:36
To: users@cloudstack.apache.org
Subject: Re: Change of guest IP address

Geoff,

Thanks for your reply. This is the first route i tried to take, but it didn't 
work for me. When I tried to remove the NIC from the guest i had an error 
message complaining that the network offering does not have dhcp service or 
something like that. I did not take a note of the actual message. This was 
after i've changed the default NIC to a temporary nic. The NIC that I have is 
from a service offering called QuickCloudNoService. I guess it's a bug...

I will try the db route and see if it works.

Thanks for your help guys

Andrei



- Original Message -
From: "Geoff Higginbottom" 
To: users@cloudstack.apache.org
Sent: Thursday, 19 December, 2013 12:19:40 PM
Subject: RE: Change of guest IP address

Andrei,

You could use the addNicToVirtualMachine API command (assuming you are running 
4.1 or 4.2)

1. Assign the VM a new 'temp' NIC on an alternate network 2. Set this new NIC 
to default 3. Remove original NIC 4. Assign a NIC on the original Network, but 
also set the required IP (hence using API and not UI) 5. Set this new NIC to 
default 6. Remove the temp NIC

API commands required are

addNicToVirtualMachine 
http://cloudstack.apache.org/docs/api/apidocs-4.2/root_admin/addNicToVirtualMachine.html

updateDefaultNicForVirtualMachine 
http://cloudstack.apache.org/docs/api/apidocs-4.2/root_admin/updateDefaultNicForVirtualMachine.html

removeNicFromVirtualMachine 
http://cloudstack.apache.org/docs/api/apidocs-4.2/root_admin/removeNicFromVirtualMachine.html

Whilst there are 6 steps, a simple CloudMonkey Script could complete this 
process in around 30 secs

Regards

Geoff Higginbottom

D: +44 20 3603 0542 | S: +44 20 3603 0540 | M: +447968161581

geoff.higginbot...@shapeblue.com

-Original Message-
From: Jayapal Reddy Uradi [mailto:jayapalreddy.ur...@citrix.com]
Sent: 19 December 2013 11:27
To: 
Subject: Re: Change of guest IP address

Hi,

There is no other way to change the ip.
If you want specific IP for the VM, you can get secondary ip  in vm NICs page 
and configure it on the VM.

Thanks,
Jayapal


On 19-Dec-2013, at 3:58 PM, Andrei Mikhailovsky  wrote:

> Do you know if there is an easier way? Like via the api calls or the 
> cloudmonkey command? Or is it currently the only way?
>
>
> - Original Message -
> From: "Jayapal Reddy Uradi" 
> To: "" 
> Sent: Thursday, 19 December, 2013 9:25:05 AM
> Subject: Re: Change of guest IP address
>
> Hi,
>
> If your VM is in isolated network please do the following
>
> 1. edit the nics table ip4_address column for your instance_id to new ip.
> 2. login to the router corresponds to the network and replace old ip with new 
> ip in below files.
>  a.  /var/lib/misc/dnsmasq.leases
>  b.  /etc/dhcphosts.txt
> 3. restart the dnsmasq in router (service dnsmasq restart) 4. Reboot
> the VM or restart the network service in Vm so that VM gets the new ip from 
> the dhcp.
>
> Thanks,
> Jayapal
>
> On 19-Dec-2013, at 2:27 PM, Andrei Mikhailovsky 
> wrote:
>
>> Hello guys,
>>
>> Could some one tell me how to change the IP address of a guest vm? It has 
>> been assigned by default by dhcp router and I would like to change it. I 
>> know how to create a new vm with a specified IP address using cloudmonkey, 
>> but I couldn't find a way of changing the IP for the existing vm.
>>
>> Cheers
>>
>> Andrei
>

This email and any attachments to it may be confidential and are intended 
solely for the use of the individual to whom it is addressed. Any views or 
opinions expressed are solely those of the author and do not necessarily 
represent those of Shape Blue Ltd or related companies. If you are not the 
intended recipient of this email, you must neither take any action based upon 
its contents, nor copy or show it to anyone. Please contact the sender if you 
believe you have received this email in error. Shape Blue Ltd is a company 
incorporated in England & Wales. ShapeBlue Services India LLP is a company 
incorporated in India and is operated under license from Shape Blue Ltd. Shape 
Blue Brasil Consultoria Ltda is a company incorporated in Brasil and is 
operated un

Re: Change of guest IP address

2013-12-19 Thread Andrei Mikhailovsky
Geoff,

Thanks for your reply. This is the first route i tried to take, but it didn't 
work for me. When I tried to remove the NIC from the guest i had an error 
message complaining that the network offering does not have dhcp service or 
something like that. I did not take a note of the actual message. This was 
after i've changed the default NIC to a temporary nic. The NIC that I have is 
from a service offering called QuickCloudNoService. I guess it's a bug...

I will try the db route and see if it works. 

Thanks for your help guys

Andrei



- Original Message -
From: "Geoff Higginbottom" 
To: users@cloudstack.apache.org
Sent: Thursday, 19 December, 2013 12:19:40 PM
Subject: RE: Change of guest IP address

Andrei,

You could use the addNicToVirtualMachine API command (assuming you are running 
4.1 or 4.2)

1. Assign the VM a new 'temp' NIC on an alternate network
2. Set this new NIC to default
3. Remove original NIC
4. Assign a NIC on the original Network, but also set the required IP (hence 
using API and not UI)
5. Set this new NIC to default
6. Remove the temp NIC

API commands required are

addNicToVirtualMachine 
http://cloudstack.apache.org/docs/api/apidocs-4.2/root_admin/addNicToVirtualMachine.html

updateDefaultNicForVirtualMachine 
http://cloudstack.apache.org/docs/api/apidocs-4.2/root_admin/updateDefaultNicForVirtualMachine.html

removeNicFromVirtualMachine 
http://cloudstack.apache.org/docs/api/apidocs-4.2/root_admin/removeNicFromVirtualMachine.html

Whilst there are 6 steps, a simple CloudMonkey Script could complete this 
process in around 30 secs

Regards

Geoff Higginbottom

D: +44 20 3603 0542 | S: +44 20 3603 0540 | M: +447968161581

geoff.higginbot...@shapeblue.com

-Original Message-
From: Jayapal Reddy Uradi [mailto:jayapalreddy.ur...@citrix.com]
Sent: 19 December 2013 11:27
To: 
Subject: Re: Change of guest IP address

Hi,

There is no other way to change the ip.
If you want specific IP for the VM, you can get secondary ip  in vm NICs page 
and configure it on the VM.

Thanks,
Jayapal


On 19-Dec-2013, at 3:58 PM, Andrei Mikhailovsky  wrote:

> Do you know if there is an easier way? Like via the api calls or the 
> cloudmonkey command? Or is it currently the only way?
>
>
> - Original Message -
> From: "Jayapal Reddy Uradi" 
> To: "" 
> Sent: Thursday, 19 December, 2013 9:25:05 AM
> Subject: Re: Change of guest IP address
>
> Hi,
>
> If your VM is in isolated network please do the following
>
> 1. edit the nics table ip4_address column for your instance_id to new ip.
> 2. login to the router corresponds to the network and replace old ip with new 
> ip in below files.
>  a.  /var/lib/misc/dnsmasq.leases
>  b.  /etc/dhcphosts.txt
> 3. restart the dnsmasq in router (service dnsmasq restart) 4. Reboot
> the VM or restart the network service in Vm so that VM gets the new ip from 
> the dhcp.
>
> Thanks,
> Jayapal
>
> On 19-Dec-2013, at 2:27 PM, Andrei Mikhailovsky 
> wrote:
>
>> Hello guys,
>>
>> Could some one tell me how to change the IP address of a guest vm? It has 
>> been assigned by default by dhcp router and I would like to change it. I 
>> know how to create a new vm with a specified IP address using cloudmonkey, 
>> but I couldn't find a way of changing the IP for the existing vm.
>>
>> Cheers
>>
>> Andrei
>

This email and any attachments to it may be confidential and are intended 
solely for the use of the individual to whom it is addressed. Any views or 
opinions expressed are solely those of the author and do not necessarily 
represent those of Shape Blue Ltd or related companies. If you are not the 
intended recipient of this email, you must neither take any action based upon 
its contents, nor copy or show it to anyone. Please contact the sender if you 
believe you have received this email in error. Shape Blue Ltd is a company 
incorporated in England & Wales. ShapeBlue Services India LLP is a company 
incorporated in India and is operated under license from Shape Blue Ltd. Shape 
Blue Brasil Consultoria Ltda is a company incorporated in Brasil and is 
operated under license from Shape Blue Ltd. ShapeBlue is a registered trademark.


RE: Change of guest IP address

2013-12-19 Thread Geoff Higginbottom
Andrei,

You could use the addNicToVirtualMachine API command (assuming you are running 
4.1 or 4.2)

1. Assign the VM a new 'temp' NIC on an alternate network
2. Set this new NIC to default
3. Remove original NIC
4. Assign a NIC on the original Network, but also set the required IP (hence 
using API and not UI)
5. Set this new NIC to default
6. Remove the temp NIC

API commands required are

addNicToVirtualMachine 
http://cloudstack.apache.org/docs/api/apidocs-4.2/root_admin/addNicToVirtualMachine.html

updateDefaultNicForVirtualMachine 
http://cloudstack.apache.org/docs/api/apidocs-4.2/root_admin/updateDefaultNicForVirtualMachine.html

removeNicFromVirtualMachine 
http://cloudstack.apache.org/docs/api/apidocs-4.2/root_admin/removeNicFromVirtualMachine.html

Whilst there are 6 steps, a simple CloudMonkey Script could complete this 
process in around 30 secs

Regards

Geoff Higginbottom

D: +44 20 3603 0542 | S: +44 20 3603 0540 | M: +447968161581

geoff.higginbot...@shapeblue.com

-Original Message-
From: Jayapal Reddy Uradi [mailto:jayapalreddy.ur...@citrix.com]
Sent: 19 December 2013 11:27
To: 
Subject: Re: Change of guest IP address

Hi,

There is no other way to change the ip.
If you want specific IP for the VM, you can get secondary ip  in vm NICs page 
and configure it on the VM.

Thanks,
Jayapal


On 19-Dec-2013, at 3:58 PM, Andrei Mikhailovsky  wrote:

> Do you know if there is an easier way? Like via the api calls or the 
> cloudmonkey command? Or is it currently the only way?
>
>
> - Original Message -
> From: "Jayapal Reddy Uradi" 
> To: "" 
> Sent: Thursday, 19 December, 2013 9:25:05 AM
> Subject: Re: Change of guest IP address
>
> Hi,
>
> If your VM is in isolated network please do the following
>
> 1. edit the nics table ip4_address column for your instance_id to new ip.
> 2. login to the router corresponds to the network and replace old ip with new 
> ip in below files.
>  a.  /var/lib/misc/dnsmasq.leases
>  b.  /etc/dhcphosts.txt
> 3. restart the dnsmasq in router (service dnsmasq restart) 4. Reboot
> the VM or restart the network service in Vm so that VM gets the new ip from 
> the dhcp.
>
> Thanks,
> Jayapal
>
> On 19-Dec-2013, at 2:27 PM, Andrei Mikhailovsky 
> wrote:
>
>> Hello guys,
>>
>> Could some one tell me how to change the IP address of a guest vm? It has 
>> been assigned by default by dhcp router and I would like to change it. I 
>> know how to create a new vm with a specified IP address using cloudmonkey, 
>> but I couldn't find a way of changing the IP for the existing vm.
>>
>> Cheers
>>
>> Andrei
>

This email and any attachments to it may be confidential and are intended 
solely for the use of the individual to whom it is addressed. Any views or 
opinions expressed are solely those of the author and do not necessarily 
represent those of Shape Blue Ltd or related companies. If you are not the 
intended recipient of this email, you must neither take any action based upon 
its contents, nor copy or show it to anyone. Please contact the sender if you 
believe you have received this email in error. Shape Blue Ltd is a company 
incorporated in England & Wales. ShapeBlue Services India LLP is a company 
incorporated in India and is operated under license from Shape Blue Ltd. Shape 
Blue Brasil Consultoria Ltda is a company incorporated in Brasil and is 
operated under license from Shape Blue Ltd. ShapeBlue is a registered trademark.


Re: Change of guest IP address

2013-12-19 Thread Jayapal Reddy Uradi
Hi,

There is no other way to change the ip.
If you want specific IP for the VM, you can get secondary ip  in vm NICs page 
and configure it on the VM.

Thanks,
Jayapal


On 19-Dec-2013, at 3:58 PM, Andrei Mikhailovsky  wrote:

> Do you know if there is an easier way? Like via the api calls or the 
> cloudmonkey command? Or is it currently the only way?
> 
> 
> - Original Message -
> From: "Jayapal Reddy Uradi" 
> To: "" 
> Sent: Thursday, 19 December, 2013 9:25:05 AM
> Subject: Re: Change of guest IP address
> 
> Hi,
> 
> If your VM is in isolated network please do the following
> 
> 1. edit the nics table ip4_address column for your instance_id to new ip.
> 2. login to the router corresponds to the network and replace old ip with new 
> ip in below files.
>  a.  /var/lib/misc/dnsmasq.leases
>  b.  /etc/dhcphosts.txt
> 3. restart the dnsmasq in router (service dnsmasq restart)
> 4. Reboot the VM or restart the network service in Vm so that VM gets the new 
> ip from the dhcp.  
> 
> Thanks,
> Jayapal
> 
> On 19-Dec-2013, at 2:27 PM, Andrei Mikhailovsky 
> wrote:
> 
>> Hello guys,
>> 
>> Could some one tell me how to change the IP address of a guest vm? It has 
>> been assigned by default by dhcp router and I would like to change it. I 
>> know how to create a new vm with a specified IP address using cloudmonkey, 
>> but I couldn't find a way of changing the IP for the existing vm.
>> 
>> Cheers
>> 
>> Andrei
> 



Re: Change of guest IP address

2013-12-19 Thread Andrei Mikhailovsky
Do you know if there is an easier way? Like via the api calls or the 
cloudmonkey command? Or is it currently the only way?


- Original Message -
From: "Jayapal Reddy Uradi" 
To: "" 
Sent: Thursday, 19 December, 2013 9:25:05 AM
Subject: Re: Change of guest IP address

Hi,

If your VM is in isolated network please do the following

1. edit the nics table ip4_address column for your instance_id to new ip.
2. login to the router corresponds to the network and replace old ip with new 
ip in below files.
  a.  /var/lib/misc/dnsmasq.leases
  b.  /etc/dhcphosts.txt
3. restart the dnsmasq in router (service dnsmasq restart)
4. Reboot the VM or restart the network service in Vm so that VM gets the new 
ip from the dhcp.  
  
Thanks,
Jayapal

On 19-Dec-2013, at 2:27 PM, Andrei Mikhailovsky 
 wrote:

> Hello guys,
> 
> Could some one tell me how to change the IP address of a guest vm? It has 
> been assigned by default by dhcp router and I would like to change it. I know 
> how to create a new vm with a specified IP address using cloudmonkey, but I 
> couldn't find a way of changing the IP for the existing vm.
> 
> Cheers
> 
> Andrei



Re: Change of guest IP address

2013-12-19 Thread Jayapal Reddy Uradi
Hi,

If your VM is in isolated network please do the following

1. edit the nics table ip4_address column for your instance_id to new ip.
2. login to the router corresponds to the network and replace old ip with new 
ip in below files.
  a.  /var/lib/misc/dnsmasq.leases
  b.  /etc/dhcphosts.txt
3. restart the dnsmasq in router (service dnsmasq restart)
4. Reboot the VM or restart the network service in Vm so that VM gets the new 
ip from the dhcp.  
  
Thanks,
Jayapal

On 19-Dec-2013, at 2:27 PM, Andrei Mikhailovsky 
 wrote:

> Hello guys,
> 
> Could some one tell me how to change the IP address of a guest vm? It has 
> been assigned by default by dhcp router and I would like to change it. I know 
> how to create a new vm with a specified IP address using cloudmonkey, but I 
> couldn't find a way of changing the IP for the existing vm.
> 
> Cheers
> 
> Andrei