Kiran Koneti created CLOUDSTACK-3188: ----------------------------------------
Summary: Not able to add network to a VM after installing the Vmtools on a windows VM.(regression) Key: CLOUDSTACK-3188 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-3188 Project: CloudStack Issue Type: Bug Security Level: Public (Anyone can view this level - this is the default.) Components: Network Devices Affects Versions: 4.2.0 Reporter: Kiran Koneti Priority: Critical Fix For: 4.2.0 Steps followed are as below: 1)Installed a VMware Advanced Zone setup. 2)once the system VM's are up added a Windows template. 3)Created a Vm using the windows864 bit template. 4)Once the VM came up tried to add a network to the VM then the below error message is observed which says the VM tools is not installed "2013-06-25 15:29:36,780 DEBUG [agent.transport.Request] (Job-Executor-18:job-151) Seq 5-1148784739: Executing: { Cmd , MgmtId: 7159676928023, via: 5, Ver: v1, Flags: 100111, [{"PlugNicCommand":{"nic":{"deviceId":1,"networkRateMbps":200,"defaultNic":false,"uuid":"91a77dc9-9958-4e5d-8992-8e5a50e9e6db","ip":"10.1.4.218","netmask":"255.255.255.0","gateway":"10.1.4.1","mac":"02:00:3e:fb:00:09","dns1":"10.103.128.16","broadcastType":"Vlan","type":"Guest","broadcastUri":"vlan://1057","isolationUri":"vlan://1057","isSecurityGroupEnabled":false},"instanceName":"i-8-51-VM","vmType":"User","wait":0}}] } 2013-06-25 15:29:36,781 DEBUG [agent.manager.DirectAgentAttache] (DirectAgent-250:null) Seq 5-1148784739: Executing request 2013-06-25 15:29:36,782 INFO [vmware.resource.VmwareResource] (DirectAgent-250:10.147.40.24) Executing resource PlugNicCommand {"nic":{"deviceId":1,"networkRateMbps":200,"defaultNic":false,"uuid":"91a77dc9-9958-4e5d-8992-8e5a50e9e6db","ip":"10.1.4.218","netmask":"255.255.255.0","gateway":"10.1.4.1","mac":"02:00:3e:fb:00:09","dns1":"10.103.128.16","broadcastType":"Vlan","type":"Guest","broadcastUri":"vlan://1057","isolationUri":"vlan://1057","isSecurityGroupEnabled":false},"instanceName":"i-8-51-VM","vmType":"User","wait":0} 2013-06-25 15:29:36,783 DEBUG [vmware.mo.HostMO] (DirectAgent-250:10.147.40.24) find VM i-8-51-VM on host 2013-06-25 15:29:36,783 DEBUG [vmware.mo.HostMO] (DirectAgent-250:10.147.40.24) load VM cache on host 2013-06-25 15:29:36,802 DEBUG [vmware.resource.VmwareResource] (DirectAgent-250:10.147.40.24) vmware tools is not installed or not running, cannot add nic to vm i-8-51-VM 2013-06-25 15:29:36,803 DEBUG [agent.manager.DirectAgentAttache] (DirectAgent-250:null) Seq 5-1148784739: Response Received: 2013-06-25 15:29:36,803 DEBUG [agent.transport.Request] (DirectAgent-250:null) Seq 5-1148784739: Processing: { Ans: , MgmtId: 7159676928023, via: 5, Ver: v1, Flags: 110, [{"PlugNicAnswer":{"result":false,"details":"Unable to execute PlugNicCommand due to vmware tools is not installed or not running, cannot add nic to vm i-8-51-VM","wait":0}}] } 2013-06-25 15:29:36,804 DEBUG [agent.transport.Request] (Job-Executor-18:job-151) Seq 5-1148784739: Received: { Ans: , MgmtId: 7159676928023, via: 5, Ver: v1, Flags: 110, { PlugNicAnswer } } 2013-06-25 15:29:36,804 WARN [cloud.vm.UserVmManagerImpl] (Job-Executor-18:job-151) Unable to plug nic for VM[User|win864vmw] due to: due to: Unable to execute PlugNicCommand due to vmware tools is not installed or not running, cannot add nic to vm i-8-51-VM 2013-06-25 15:29:36,808 WARN [cloud.vm.VirtualMachineManagerImpl] (Job-Executor-18:job-151) Failed to plug nic to the vm VM[User|win864vmw] in network Ntwk[226|Guest|8] 2013-06-25 15:29:36,806 DEBUG [agent.manager.AgentAttache] (DirectAgent-250:null) Seq 5-1148784739: No more commands found 2013-06-25 15:29:36,830 DEBUG [cloud.network.NetworkModelImpl] (Job-Executor-18:job-151) Service SecurityGroup is not supported in the network id=226 2013-06-25 15:29:36,854 DEBUG [cloud.network.NetworkManagerImpl] (Job-Executor-18:job-151) Removed nic id=126 2013-06-25 15:29:36,857 DEBUG [cloud.network.NetworkManagerImpl] (Job-Executor-18:job-151) Revoving nic secondary ip entry ... 2013-06-25 15:29:36,858 ERROR [cloud.async.AsyncJobManagerImpl] (Job-Executor-18:job-151) Unexpected exception while executing org.apache.cloudstack.api.command.user.vm.AddNicToVMCmd com.cloud.utils.exception.CloudRuntimeException: Unable to add NIC to VM[User|win864vmw] at com.cloud.vm.UserVmManagerImpl.addNicToVirtualMachine(UserVmManagerImpl.java:899) at org.apache.cloudstack.api.command.user.vm.AddNicToVMCmd.execute(AddNicToVMCmd.java:109) at com.cloud.api.ApiDispatcher.dispatch(ApiDispatcher.java:155) at com.cloud.async.AsyncJobManagerImpl$1.run(AsyncJobManagerImpl.java:437) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) 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:679) 2013-06-25 15:29:36,860 DEBUG [cloud.async.AsyncJobManagerImpl] (Job-Executor-18:job-151) Complete async job-151, jobStatus: 2, resultCode: 530, result: Error Code: 530 Error text: Unable to add NIC to VM[User|win864vmw]" 6)Then I installed the VM tools on the VM and tried to add the same network again and the below error message is observed which says "Ntwk[226|Guest|8] already has a vm with host name: 'win864vmw" "2013-06-25 15:50:54,931 DEBUG [cloud.api.ApiServlet] (catalina-exec-4:null) ===END=== 10.146.0.17 -- GET command=addNicToVirtualMachine&response=json&sessionkey=2HBBJ%2FP4weTbwI0FcPTjrcNXmMw%3D&virtualmachineid=87bfdb25-ddd9-44f9-a545-31d97e04e753&networkid=153c0cf7-3cbf-4748-9e96-aa8e5405c1fd&_=1372155655303 2013-06-25 15:50:54,935 DEBUG [cloud.async.AsyncJobManagerImpl] (Job-Executor-26:job-158) Executing org.apache.cloudstack.api.command.user.vm.AddNicToVMCmd for job-158 2013-06-25 15:50:54,982 ERROR [cloud.async.AsyncJobManagerImpl] (Job-Executor-26:job-158) Unexpected exception while executing org.apache.cloudstack.api.command.user.vm.AddNicToVMCmd com.cloud.utils.exception.CloudRuntimeException: Ntwk[226|Guest|8] already has a vm with host name: 'win864vmw at com.cloud.vm.UserVmManagerImpl.addNicToVirtualMachine(UserVmManagerImpl.java:883) at org.apache.cloudstack.api.command.user.vm.AddNicToVMCmd.execute(AddNicToVMCmd.java:109) at com.cloud.api.ApiDispatcher.dispatch(ApiDispatcher.java:155) at com.cloud.async.AsyncJobManagerImpl$1.run(AsyncJobManagerImpl.java:437) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) 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:679)" 7)When verified the nics table for this VM it shows it has two nics but one is in the removed state. "mysql> select * from nics where instance_id=51\G; *************************** 1. row *************************** id: 122 uuid: 9387f2ab-619b-4148-ba53-7611b7c87b3e instance_id: 51 mac_address: 02:00:60:4e:00:01 ip4_address: 10.1.1.65 netmask: 255.255.255.0 gateway: 10.1.1.1 ip_type: Ip4 broadcast_uri: vlan://1058 network_id: 229 mode: Dhcp state: Reserved strategy: Start reserver_name: ExternalGuestNetworkGuru reservation_id: 980c1bab-a069-4d78-a3a2-045c0836094d device_id: 0 update_time: 2013-06-25 15:14:36 isolation_uri: vlan://1058 ip6_address: NULL default_nic: 1 vm_type: User created: 2013-06-25 09:43:09 removed: NULL ip6_gateway: NULL ip6_cidr: NULL secondary_ip: 0 display_nic: 1 *************************** 2. row *************************** id: 126 uuid: 91a77dc9-9958-4e5d-8992-8e5a50e9e6db instance_id: 51 mac_address: 02:00:3e:fb:00:09 ip4_address: 10.1.4.218 netmask: 255.255.255.0 gateway: 10.1.4.1 ip_type: Ip4 broadcast_uri: vlan://1057 network_id: 226 mode: Dhcp state: Deallocating strategy: Start reserver_name: ExternalGuestNetworkGuru reservation_id: NULL device_id: 1 update_time: 2013-06-25 15:29:36 isolation_uri: vlan://1057 ip6_address: NULL default_nic: 0 vm_type: User created: 2013-06-25 09:59:34 removed: 2013-06-25 09:59:36 ip6_gateway: NULL ip6_cidr: NULL secondary_ip: 0 display_nic: 1 2 rows in set (0.00 sec)" 8)When checked the VM details in the network we don't see the VM is associated with the network. "mysql> select id,name,instance_name,state from vm_instance where id in (select instance_id from nics where network_id=226 and removed is null); +----+--------------------------------------+---------------+---------+ | id | name | instance_name | state | +----+--------------------------------------+---------------+---------+ | 39 | r-39-VM | r-39-VM | Running | | 44 | e4f1ac20-e6fb-47f7-8eed-a298a1d0fb04 | i-2-44-VM | Running | | 45 | 3fef58e7-d386-4441-a722-8ac2c6b756de | i-2-45-VM | Stopped | | 46 | 0fdf1bcb-7539-4130-8052-a86a8a6677f1 | i-2-46-VM | Running | | 47 | 7259302d-045a-4400-b367-de545fe328b1 | i-2-47-VM | Running | | 48 | 9728a526-d8c0-443a-aae9-786f107bfd5d | i-2-48-VM | Stopped | +----+--------------------------------------+---------------+---------+ 6 rows in set (0.01 sec)" The same is also observed with the Xen setup using the pv drivers. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira