/** * get the list of all active Vm id's in the VPC for all ther tiers */ @Override public List<Long> getAllActiveVmsInVpc(long vpcId) { Set<Long> vmIdsSet = new HashSet<>(); List<? extends Network> vpcNetworks = _vpcMgr.getVpcNetworks(vpcId); for (Network network : vpcNetworks) { List<Long> networkVmIds = getAllActiveVmsInNetwork(network.getId()); if (networkVmIds != null && !networkVmIds.isEmpty()) { vmIdsSet.addAll(networkVmIds); } } List<Long> vmIds = new ArrayList<>(); vmIds.addAll(vmIdsSet); return vmIds; }
/** * get the list of all Vm id's in the VPC for all the tiers that are running on the host */ @Override public List<Long> getActiveVmsInVpcOnHost(long vpcId, long hostId) { Set<Long> vmIdsSet = new HashSet<>(); List<? extends Network> vpcNetworks = _vpcMgr.getVpcNetworks(vpcId); for (Network network : vpcNetworks) { List<Long> networkVmIds = getActiveVmsInNetworkOnHost(network.getId(), hostId, false); if (networkVmIds != null && !networkVmIds.isEmpty()) { vmIdsSet.addAll(networkVmIds); } } List<Long> vmIds = new ArrayList<>(); vmIds.addAll(vmIdsSet); return vmIds; }
/** * get the list of hypervisor hosts on which VM's belonging to a VPC currently spans */ @Override public List<Long> getVpcSpannedHosts(long vpcId) { List<? extends Network> vpcNetworks = _vpcMgr.getVpcNetworks(vpcId); List<Long> vpcHostIds = new ArrayList<>(); for (Network vpcNetwork : vpcNetworks) { List<Long> networkHostIds = getNetworkSpanedHosts(vpcNetwork.getId()); if (networkHostIds != null && !networkHostIds.isEmpty()) { for (Long hostId : networkHostIds) { if (!vpcHostIds.contains(hostId)) { vpcHostIds.add(hostId); } } } } return vpcHostIds; }
List<? extends Network> vpcNetworks = _vpcMgr.getVpcNetworks(vpcId); assert (vpc != null && (vpcNetworks != null && !vpcNetworks.isEmpty())): "invalid vpc id";
assert (vpc != null): "invalid vpc id"; List<? extends Network> vpcNetworks = _vpcMgr.getVpcNetworks(vpcId); List<Long> hostIds = _ovsNetworkToplogyGuru.getVpcSpannedHosts(vpcId); List<Long> vmIds = _ovsNetworkToplogyGuru.getAllActiveVmsInVpc(vpcId);
List<? extends Network> vpcNetworks = _vpcMgr.getVpcNetworks(vpcId); List<Long> vpcSpannedHostIds = _ovsNetworkToplogyGuru.getVpcSpannedHosts(vpcId); for (Network vpcNetwork: vpcNetworks) {
final List<? extends Network> guestNetworks = vpcMgr.getVpcNetworks(vpcId); for (final Network guestNetwork : guestNetworks) { if (_networkModel.isPrivateGateway(guestNetwork.getId())) {
List<? extends Network> vpcNetworks = _vpcMgr.getVpcNetworks(nw.getVpcId()); try { for (Network network: vpcNetworks) {