[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-7153?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14113673#comment-14113673
 ] 

Damodar Reddy T commented on CLOUDSTACK-7153:
---------------------------------------------

Problem:
-----------------------------------
When event bus is enabled and while adding a nic to a VM, This creates an 
entity into nic but will not put the created entity's uuid into the event bus 
message.
Root Cause Analysis:
-----------------------------------
In UserVmManager.addNicToVirtualMachine which is called by addNicToVmCmd was 
not putting the created entity's uuid into the CallContext so the Event NIC 
Complete was not able to get the id during event complete call so was not 
putting the same into event bus message.
Solution proposed:
------------------------------------
Put the created entity's uuid into CallContext before returning from 
UserVmManager.addNicToVirtualMachine call
QA Notes:
-----------------------------------
Make sure the entity's uuid is coming in event bus message during event 
complete call.


> addNicToVirtualMachine not BaseAsyncCreate but creates an entity
> ----------------------------------------------------------------
>
>                 Key: CLOUDSTACK-7153
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-7153
>             Project: CloudStack
>          Issue Type: Bug
>      Security Level: Public(Anyone can view this level - this is the 
> default.) 
>          Components: Management Server
>    Affects Versions: 4.4.0
>            Reporter: Damodar Reddy T
>            Assignee: Damodar Reddy T
>             Fix For: 4.5.0
>
>
> addNicToVirtualMachine not BaseAsyncCreate but creates an entity.
> We need them to be BaseAsyncCreate so that Eventbus while publishing the 
> completed events can put in the entity id. Right now there is a generic logic 
> where after create function when the id is created its pushed into the 
> context so that Eventbus can use it to publish the created UUID. If its not 
> baseAsyncCreate you will have to go into each api and put the id in the 
> context.
> Currently following is the generic code had put in ApiServer.java. We will 
> have to do specifically into your api. Do this only if there is a hard reason 
> not to make it baseasyncCreate
> Class entityClass = 
> EventTypes.getEntityClassForEvent(createCmd.getEventType());
> if (entityClass != null)
> ctx.putContextParameter(entityClass.getName(), objectId);



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to