@Override public boolean release(Network network, NicProfile nic, VirtualMachineProfile vm, ReservationContext context) { if (!nic.isDefaultNic()) { return true; } try { return deleteConfigDriveIso(vm.getVirtualMachine()); } catch (ResourceUnavailableException e) { LOG.error("Failed to delete config drive due to: ", e); return false; } }
@Override public boolean prepareMigration(NicProfile nic, Network network, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) { if (nic.isDefaultNic() && _networkModel.getUserDataUpdateProvider(network).getProvider().equals(Provider.ConfigDrive)) { LOG.trace(String.format("[prepareMigration] for vm: %s", vm.getInstanceName())); final DataStore dataStore = findDataStore(vm, dest); addConfigDriveDisk(vm, dataStore); return false; } else return true; }
if (vm != null && requested != null && requested.isDefaultNic()) { isDefaultNic = true; if (vmNic.isDefaultNic()) { if (defaultNic != null) { throw new IllegalArgumentException("You cannot specify two nics as default nics: nic 1 = " + defaultNic + "; nic 2 = " + vmNic);
buf.append(" eth").append(deviceId).append("mask=").append(nic.getIPv4Netmask()); if (nic.isDefaultNic()) { buf.append(" gateway=").append(nic.getIPv4Gateway()); buf.append(" dns1=").append(nic.getIPv4Gateway());
if (nic.isDefaultNic()) { buf.append(" gateway=").append(nic.getIPv4Gateway());
buf.append(" eth").append(deviceId).append("ip=").append(nic.getIPv4Address()); buf.append(" eth").append(deviceId).append("mask=").append(nic.getIPv4Netmask()); if (nic.isDefaultNic()) { buf.append(" gateway=").append(nic.getIPv4Gateway()); defaultDns1 = nic.getIPv4Dns1();
if (guestNic.isDefaultNic()) { cidrSize = NetUtils.getCidrSize(guestNic.getIPv4Netmask()); final String cidr = NetUtils.getCidrSubNet(guestNic.getIPv4Gateway(), cidrSize);
if (nic.isDefaultNic()) { if (ipv4) { buf.append(" gateway=").append(nic.getIPv4Gateway());
if (result) { s_logger.debug("Nic is plugged successfully for vm " + vm + " in network " + network + ". Vm is a part of network now"); final long isDefault = nic.isDefaultNic() ? 1 : 0;
if (password != null && nic.isDefaultNic()) { SavePasswordCommand cmd = new SavePasswordCommand(password, nic.getIPv4Address(), uservm.getHostName(), _networkMgr.getExecuteInSeqNtwkElmtCmd()); cmds.addCommand("password", cmd);
to.setDns2(profile.getIPv4Dns2()); to.setGateway(profile.getIPv4Gateway()); to.setDefaultNic(profile.isDefaultNic()); to.setBroadcastUri(profile.getBroadCastUri()); to.setIsolationuri(profile.getIsolationUri());
List<NicProfile> nicProfiles = _networkMgr.getNicProfiles(vmInstance); for (NicProfile nicProfile : nicProfiles) { if (nicProfile.isDefaultNic() && existingdefaultnet != null && nicProfile.getNetworkId() == existingdefaultnet.getId()) { existing = nicProfile;
protected Integer applyProfileToNic(final NicVO vo, final NicProfile profile, Integer deviceId) { if (profile.getDeviceId() != null) { vo.setDeviceId(profile.getDeviceId()); } else if (deviceId != null) { vo.setDeviceId(deviceId++); } if (profile.getReservationStrategy() != null) { vo.setReservationStrategy(profile.getReservationStrategy()); } vo.setDefaultNic(profile.isDefaultNic()); vo.setIPv4Address(profile.getIPv4Address()); vo.setAddressFormat(profile.getFormat()); if (profile.getMacAddress() != null) { vo.setMacAddress(profile.getMacAddress()); } vo.setMode(profile.getMode()); vo.setIPv4Netmask(profile.getIPv4Netmask()); vo.setIPv4Gateway(profile.getIPv4Gateway()); if (profile.getBroadCastUri() != null) { vo.setBroadcastUri(profile.getBroadCastUri()); } if (profile.getIsolationUri() != null) { vo.setIsolationUri(profile.getIsolationUri()); } vo.setState(Nic.State.Allocated); vo.setIPv6Address(profile.getIPv6Address()); vo.setIPv6Gateway(profile.getIPv6Gateway()); vo.setIPv6Cidr(profile.getIPv6Cidr()); return deviceId; }