@Override public NicVO savePlaceholderNic(final Network network, final String ip4Address, final String ip6Address, final Type vmType) { final NicVO nic = new NicVO(null, null, network.getId(), null); nic.setIPv4Address(ip4Address); nic.setIPv6Address(ip6Address); nic.setReservationStrategy(ReservationStrategy.PlaceHolder); nic.setState(Nic.State.Reserved); nic.setVmType(vmType); return _nicDao.persist(nic); }
if (nic.getReservationStrategy() == Nic.ReservationStrategy.Start) { final NetworkGuru guru = AdapterBase.getAdapterByName(networkGurus, network.getGuruName()); nic.setState(Nic.State.Releasing); _nicDao.update(nic.getId(), nic); final NicProfile profile = new NicProfile(nic, network, nic.getBroadcastUri(), nic.getIsolationUri(), null, _networkModel if (guru.release(profile, vmProfile, nic.getReservationId())) { applyProfileToNicForRelease(nic, profile); nic.setState(Nic.State.Allocated); if (originalState == Nic.State.Reserved) { updateNic(nic, network.getId(), -1); nic.setState(Nic.State.Allocated); updateNic(nic, network.getId(), -1);
nic.setState(Nic.State.Deallocating); _nicDao.update(nic.getId(), nic); final NetworkVO network = _networksDao.findById(nic.getNetworkId());
nic.setState(Nic.State.Reserving); nic.setReservationId(context.getReservationId()); _nicDao.update(nic.getId(), nic); nic.setBroadcastUri(profile.getBroadCastUri()); nic.setReserver(guru.getName()); nic.setState(Nic.State.Reserved); nic.setIPv4Netmask(profile.getIPv4Netmask()); nic.setIPv4Gateway(profile.getIPv4Gateway()); _networkModel.getNetworkTag(vmProfile.getHypervisorType(), network)); guru.updateNicProfile(profile, network); nic.setState(Nic.State.Reserved); updateNic(nic, network.getId(), 1);
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; }