shweta agarwal created CLOUDSTACK-2086:
------------------------------------------

             Summary: UI shows added NIC even if  Actual NIC addition has failed
                 Key: CLOUDSTACK-2086
                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-2086
             Project: CloudStack
          Issue Type: Bug
      Security Level: Public (Anyone can view this level - this is the default.)
          Components: Network Controller, UI
    Affects Versions: 4.2.0
         Environment: build: CloudStack-non-OSS-MASTER-219-rhel6.3.tar.gz
            Reporter: shweta agarwal
            Priority: Critical
             Fix For: 4.2.0


Repro steps:

Create a VM
Create a shared network
Call Add Nic  Api 


 Notice Entries in Db is created  even though actual addition of NIC has failed 
as a result the newly added nic is shown in UI

MS log shows 
2013-04-18 13:03:57,821 ERROR [cloud.async.AsyncJobManagerImpl] 
(Job-Executor-51:job-41) Unexpected exception while executing 
org.apache.cloudstack.api.command.user.vm.AddNicToVMCmd
java.lang.NullPointerException
        at 
com.cloud.network.element.VirtualRouterElement.getRouters(VirtualRouterElement.java:879)
        at 
com.cloud.network.element.VirtualRouterElement.addDhcpEntry(VirtualRouterElement.java:826)
        at 
com.cloud.network.NetworkManagerImpl.prepareElement(NetworkManagerImpl.java:1591)
        at 
com.cloud.network.NetworkManagerImpl.prepareNic(NetworkManagerImpl.java:1702)
        at 
com.cloud.network.NetworkManagerImpl.createNicForVm(NetworkManagerImpl.java:3636)
        at 
com.cloud.vm.VirtualMachineManagerImpl.addVmToNetwork(VirtualMachineManagerImpl.java:2522)
        at 
com.cloud.vm.UserVmManagerImpl.addNicToVirtualMachine(UserVmManagerImpl.java:860)
        at 
org.apache.cloudstack.api.command.user.vm.AddNicToVMCmd.execute(AddNicToVMCmd.java:109)
        at com.cloud.api.ApiDispatcher.dispatch(ApiDispatcher.java:164)
        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-04-18 13:03:57,823 DEBUG [cloud.async.AsyncJobManagerImpl] 
(Job-Executor-51:job-41) Complete async job-41, jobStatus: 2, resultCode: 530, 
result: Error Code: 530 Error text: null
2013-04-18 13:04:01,436 DEBUG [cloud.network.NetworkManagerImpl] 
(Network-Scavenger-1:null) We found network 204 to be free for the first time.  
Adding it to the list: 1334281876
2013-04-18 13:04:08,819 DEBUG [agent.manager.DirectAgentAttache] 
(DirectAgent-142:null) Ping from 1
2013-04-18 13:04:09,058 DEBUG [storage.secondary.SecondaryStorageManagerImpl] 
(secstorage-1:null) Zone 1 is ready to launch secondary storage VM
2013-04-18 13:04:09,373 DEBUG [cloud.consoleproxy.ConsoleProxyManagerImpl] 
(consoleproxy-1:nu

UI snap shot attached :


DB showing :
"id"    "uuid"  "instance_id"   "mac_address"   "ip4_address"   "netmask"       
"gateway"       "ip_type"       "broadcast_uri" "network_id"    "mode"  "state" 
"strategy"      "reserver_name" "reservation_id"        "device_id"     
"update_time"   "isolation_uri" "ip6_address"   "default_nic"   "vm_type"       
"created"       "removed"       "ip6_gateway"   "ip6_cidr"      "secondary_ip"
"41"    "f12806c9-8792-4fc2-bfc7-4362d2f3015a"  NULL    NULL    "10.147.51.121" 
NULL    NULL    NULL    NULL    "212"   NULL    "Reserved"      "PlaceHolder"   
NULL    NULL    "0"     "2013-04-18 13:02:17"   NULL    NULL    "0"     
"DomainRouter"  "2013-04-18 17:02:17"   NULL    NULL    NULL    "0"

Even though instance id is null still UI showing this NIC in UI.

I think entry in DB should only be made once the addnic comand  passes



--
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

Reply via email to