rafaelweingartner commented on a change in pull request #2672:
CLOUDSTACK-10377: Fix Network restart for Nuage
URL: https://github.com/apache/cloudstack/pull/2672#discussion_r190858465
##########
File path:
plugins/network-elements/nuage-vsp/src/com/cloud/network/guru/NuageVspGuestNetworkGuru.java
##########
@@ -528,29 +533,35 @@ public void reserve(NicProfile nic, Network network,
VirtualMachineProfile vm, D
nic.setBroadcastUri(network.getBroadcastUri());
nic.setIsolationUri(network.getBroadcastUri());
- //NicProfile does not contain the NIC UUID. We need this
information to set it in the VMInterface and VPort
- //that we create in VSP
- NicVO nicFromDb = _nicDao.findById(nic.getId());
- IPAddressVO staticNatIp =
_ipAddressDao.findByVmIdAndNetworkId(network.getId(), vm.getId());
VspVm vspVm =
_nuageVspEntityBuilder.buildVspVm(vm.getVirtualMachine(), network);
- VspNic vspNic =
_nuageVspEntityBuilder.buildVspNic(nicFromDb.getUuid(), nic);
- VspStaticNat vspStaticNat = null;
- if (staticNatIp != null) {
- VlanVO staticNatVlan =
_vlanDao.findById(staticNatIp.getVlanId());
- vspStaticNat = _nuageVspEntityBuilder.buildVspStaticNat(null,
staticNatIp, staticNatVlan, vspNic);
- }
- boolean defaultHasDns = getDefaultHasDns(networkHasDnsCache,
nicFromDb);
- VspDhcpVMOption dhcpOption =
_nuageVspEntityBuilder.buildVmDhcpOption(nicFromDb, defaultHasDns,
networkHasDns);
- ReserveVmInterfaceVspCommand cmd = new
ReserveVmInterfaceVspCommand(vspNetwork, vspVm, vspNic, vspStaticNat,
dhcpOption);
- Answer answer = _agentMgr.easySend(nuageVspHost.getId(), cmd);
+ if
(!Boolean.TRUE.equals(vm.getParameter(VirtualMachineProfile.Param.RollingRestart)))
{
Review comment:
You can use `BooleanUtils` to evaluate
`vm.getParameter(VirtualMachineProfile.Param.RollingRestart))`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services