Skip to content

Commit c43b569

Browse files
DamodarKishan Kavala
authored andcommitted
CLOUDSTACK-7153: addNicToVirtualMachine not BaseAsyncCreate but creates an entity
1 parent d3af2db commit c43b569

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

api/src/com/cloud/event/EventTypes.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import com.cloud.server.ResourceTag;
3232
import com.cloud.storage.snapshot.SnapshotPolicy;
3333
import com.cloud.vm.ConsoleProxy;
34+
import com.cloud.vm.Nic;
3435
import com.cloud.vm.NicSecondaryIp;
3536
import com.cloud.vm.SecondaryStorageVm;
3637
import org.apache.cloudstack.config.Configuration;
@@ -575,6 +576,8 @@ public class EventTypes {
575576
entityEventDetails.put(EVENT_FIREWALL_EGRESS_CLOSE, FirewallRule.class);
576577
entityEventDetails.put(EVENT_FIREWALL_EGRESS_UPDATE, FirewallRule.class);
577578

579+
// Nic Events
580+
entityEventDetails.put(EVENT_NIC_CREATE, Nic.class);
578581

579582
// Load Balancers
580583
entityEventDetails.put(EVENT_ASSIGN_TO_LOAD_BALANCER_RULE, FirewallRule.class);

server/src/com/cloud/vm/UserVmManagerImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1041,7 +1041,7 @@ public UserVm addNicToVirtualMachine(AddNicToVMCmd cmd) throws InvalidParameterV
10411041
if (guestNic == null) {
10421042
throw new CloudRuntimeException("Unable to add NIC to " + vmInstance);
10431043
}
1044-
1044+
CallContext.current().putContextParameter(Nic.class.getName(), guestNic.getUuid());
10451045
s_logger.debug("Successful addition of " + network + " from " + vmInstance);
10461046
return _vmDao.findById(vmInstance.getId());
10471047
}

0 commit comments

Comments
 (0)