|
41 | 41 |
|
42 | 42 | import com.cloud.agent.api.PrepareForMigrationAnswer; |
43 | 43 | import com.cloud.agent.api.to.DpdkTO; |
| 44 | +import com.cloud.offering.NetworkOffering; |
| 45 | +import com.cloud.offerings.dao.NetworkOfferingDetailsDao; |
44 | 46 | import org.apache.cloudstack.affinity.dao.AffinityGroupVMMapDao; |
45 | 47 | import org.apache.cloudstack.api.command.admin.vm.MigrateVMCmd; |
46 | 48 | import org.apache.cloudstack.api.command.admin.volume.MigrateVolumeCmdByAdmin; |
@@ -320,6 +322,8 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac |
320 | 322 | private AsyncJobManager _jobMgr; |
321 | 323 | @Inject |
322 | 324 | private StorageManager storageMgr; |
| 325 | + @Inject |
| 326 | + private NetworkOfferingDetailsDao networkOfferingDetailsDao; |
323 | 327 |
|
324 | 328 | VmWorkJobHandlerProxy _jobHandlerProxy = new VmWorkJobHandlerProxy(this); |
325 | 329 |
|
@@ -3475,6 +3479,16 @@ private NicProfile orchestrateAddVmToNetwork(final VirtualMachine vm, final Netw |
3475 | 3479 | //3) Convert nicProfile to NicTO |
3476 | 3480 | final NicTO nicTO = toNicTO(nic, vmProfile.getVirtualMachine().getHypervisorType()); |
3477 | 3481 |
|
| 3482 | + if (network != null) { |
| 3483 | + final Map<NetworkOffering.Detail, String> details = networkOfferingDetailsDao.getNtwkOffDetails(network.getNetworkOfferingId()); |
| 3484 | + if (details != null) { |
| 3485 | + details.putIfAbsent(NetworkOffering.Detail.PromiscuousMode, NetworkOrchestrationService.PromiscuousMode.value().toString()); |
| 3486 | + details.putIfAbsent(NetworkOffering.Detail.MacAddressChanges, NetworkOrchestrationService.MacAddressChanges.value().toString()); |
| 3487 | + details.putIfAbsent(NetworkOffering.Detail.ForgedTransmits, NetworkOrchestrationService.ForgedTransmits.value().toString()); |
| 3488 | + } |
| 3489 | + nicTO.setDetails(details); |
| 3490 | + } |
| 3491 | + |
3478 | 3492 | //4) plug the nic to the vm |
3479 | 3493 | s_logger.debug("Plugging nic for vm " + vm + " in network " + network); |
3480 | 3494 |
|
|
0 commit comments