Merge remote-tracking branch 'origin/4.13'

This commit is contained in:
Rohit Yadav 2019-10-18 12:29:24 +05:30
commit 294813e8fe
3 changed files with 9 additions and 15 deletions

View File

@ -2014,6 +2014,15 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
final List<NicVO> nics = _nicDao.listByVmId(vm.getId());
for (final NicVO nic : nics) {
final NetworkVO network = _networksDao.findById(nic.getNetworkId());
if (network != null && network.getTrafficType() == TrafficType.Guest) {
final String nicIp = Strings.isNullOrEmpty(nic.getIPv4Address()) ? nic.getIPv6Address() : nic.getIPv4Address();
if (!Strings.isNullOrEmpty(nicIp)) {
NicProfile nicProfile = new NicProfile(nic.getIPv4Address(), nic.getIPv6Address(), nic.getMacAddress());
nicProfile.setId(nic.getId());
cleanupNicDhcpDnsEntry(network, vm, nicProfile);
}
}
removeNic(vm, nic);
}
}

View File

@ -896,7 +896,6 @@ NetworkMigrationResponder, AggregatedCommandExecutor, RedundantResource, DnsServ
@Override
public boolean release(final Network network, final NicProfile nic, final VirtualMachineProfile vm, final ReservationContext context) throws ConcurrentOperationException,
ResourceUnavailableException {
removeDhcpEntry(network, nic, vm);
return true;
}

View File

@ -312,7 +312,6 @@ import com.cloud.vm.dao.VMInstanceDao;
import com.cloud.vm.snapshot.VMSnapshotManager;
import com.cloud.vm.snapshot.VMSnapshotVO;
import com.cloud.vm.snapshot.dao.VMSnapshotDao;
import com.google.common.base.Strings;
public class UserVmManagerImpl extends ManagerBase implements UserVmManager, VirtualMachineGuru, UserVmService, Configurable {
private static final Logger s_logger = Logger.getLogger(UserVmManagerImpl.class);
@ -4479,19 +4478,6 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
@Override
public void finalizeExpunge(VirtualMachine vm) {
final VirtualMachineProfile profile = new VirtualMachineProfileImpl(vm);
final List<NicVO> nics = _nicDao.listByVmId(vm.getId());
for (final NicVO nic : nics) {
final NetworkVO network = _networkDao.findById(nic.getNetworkId());
if (network != null && network.getTrafficType() == TrafficType.Guest) {
final String nicIp = Strings.isNullOrEmpty(nic.getIPv4Address()) ? nic.getIPv6Address() : nic.getIPv4Address();
if (!Strings.isNullOrEmpty(nicIp)) {
NicProfile nicProfile = new NicProfile(nic.getIPv4Address(), nic.getIPv6Address(), nic.getMacAddress());
nicProfile.setId(nic.getId());
_networkMgr.cleanupNicDhcpDnsEntry(network, profile, nicProfile);
}
}
}
}
@Override