final int devId = vmNic.getDeviceId(); if (devId >= deviceIds.length) { throw new IllegalArgumentException("Device id for nic is too large: " + vmNic);
final int deviceId = nic.getDeviceId(); buf.append(" eth").append(deviceId).append("ip=").append(nic.getIPv4Address()); buf.append(" eth").append(deviceId).append("mask=").append(nic.getIPv4Netmask());
int deviceId = nic.getDeviceId(); if (nic.getIPv4Address() == null) { buf.append(" eth").append(deviceId).append("ip=").append("0.0.0.0");
int deviceId = nic.getDeviceId(); buf.append(" eth").append(deviceId).append("ip=").append(nic.getIPv4Address()); buf.append(" eth").append(deviceId).append("mask=").append(nic.getIPv4Netmask());
String defaultIp6Dns2 = null; for (final NicProfile nic : profile.getNics()) { final int deviceId = nic.getDeviceId(); boolean ipv4 = false, ipv6 = false; if (nic.getIPv4Address() != null) {
throws InsufficientVirtualNetworkCapacityException, InsufficientAddressCapacityException, ConcurrentOperationException { s_logger.debug("reserve NicProfile on network id: " + network.getId() + " " + network.getName()); s_logger.debug("deviceId: " + nic.getDeviceId()); ipModel = new InstanceIpModel(vm.getInstanceName(), nic.getDeviceId()); ipModel.addToVMInterface(vmiModel); } else {
NicProfile nicProfile = new NicProfile(originalNic, networkInNewPhysicalNet, null, null, null, _networkModel.isSecurityGroupSupportedInNetwork(networkInNewPhysicalNet), null); try { nicProfile = _networkMgr.allocateNic(nicProfile, networkInNewPhysicalNet, originalNic.isDefaultNic(), nicProfile.getDeviceId(), vmProfile).first(); } catch (InsufficientVirtualNetworkCapacityException | InsufficientAddressCapacityException e) { throw new CloudRuntimeException("Allocation of new nicProfile failed during migration", e);
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; }
@Override public NicTO toNicTO(NicProfile profile) { NicTO to = new NicTO(); to.setDeviceId(profile.getDeviceId()); to.setBroadcastType(profile.getBroadcastType()); to.setType(profile.getTrafficType());
Integer existingID = existing.getDeviceId();