diff --git a/engine/schema/src/main/java/com/cloud/vm/dao/VMInstanceDaoImpl.java b/engine/schema/src/main/java/com/cloud/vm/dao/VMInstanceDaoImpl.java index 1d7d4440566..97a505d7c8f 100755 --- a/engine/schema/src/main/java/com/cloud/vm/dao/VMInstanceDaoImpl.java +++ b/engine/schema/src/main/java/com/cloud/vm/dao/VMInstanceDaoImpl.java @@ -274,6 +274,7 @@ public class VMInstanceDaoImpl extends GenericDaoBase implem SearchBuilder nicSearch = _nicDao.createSearchBuilder(); nicSearch.and("networkId", nicSearch.entity().getNetworkId(), SearchCriteria.Op.EQ); + nicSearch.and("removedNic", nicSearch.entity().getRemoved(), SearchCriteria.Op.NULL); DistinctHostNameSearch = createSearchBuilder(String.class); DistinctHostNameSearch.selectFields(DistinctHostNameSearch.entity().getHostName()); diff --git a/server/src/main/java/com/cloud/vm/UserVmManagerImpl.java b/server/src/main/java/com/cloud/vm/UserVmManagerImpl.java index df7884c80e3..fcf7008ad28 100644 --- a/server/src/main/java/com/cloud/vm/UserVmManagerImpl.java +++ b/server/src/main/java/com/cloud/vm/UserVmManagerImpl.java @@ -1065,6 +1065,8 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir // Check that the specified service offering ID is valid _itMgr.checkIfCanUpgrade(vmInstance, newServiceOffering); + resizeRootVolumeOfVmWithNewOffering(vmInstance, newServiceOffering); + _itMgr.upgradeVmDb(vmId, newServiceOffering, currentServiceOffering); // Increment or decrement CPU and Memory count accordingly. @@ -1327,17 +1329,14 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir throw new CloudRuntimeException(vmInstance + " is in zone:" + vmInstance.getDataCenterId() + " but " + network + " is in zone:" + network.getDataCenterId()); } - // Get all vms hostNames in the network - List hostNames = _vmInstanceDao.listDistinctHostNames(network.getId()); - // verify that there are no duplicates, listDistictHostNames could return hostNames even if the NIC - //in the network is removed, so also check if the NIC is present and then throw an exception. - //This will also check if there are multiple nics of same vm in the network - if (hostNames.contains(vmInstance.getHostName())) { - for (String hostName : hostNames) { - VMInstanceVO vm = _vmInstanceDao.findVMByHostName(hostName); - if (_networkModel.getNicInNetwork(vm.getId(), network.getId()) != null && vm.getHostName().equals(vmInstance.getHostName())) { - throw new CloudRuntimeException(network + " already has a vm with host name: " + vmInstance.getHostName()); - } + if(_networkModel.getNicInNetwork(vmInstance.getId(),network.getId()) != null){ + s_logger.debug("VM " + vmInstance.getHostName() + " already in network " + network.getName() + " going to add another NIC"); + } else { + //* get all vms hostNames in the network + List hostNames = _vmInstanceDao.listDistinctHostNames(network.getId()); + //* verify that there are no duplicates + if (hostNames.contains(vmInstance.getHostName())) { + throw new CloudRuntimeException("Network " + network.getName() + " already has a vm with host name: " + vmInstance.getHostName()); } } diff --git a/systemvm/test/runtests.sh b/systemvm/test/runtests.sh index 94958e531b0..c6a58bdb92a 100644 --- a/systemvm/test/runtests.sh +++ b/systemvm/test/runtests.sh @@ -26,7 +26,7 @@ pycodestyle --max-line-length=179 *py pycodestyle --max-line-length=179 --exclude=monitorServices.py,baremetal-vr.py,passwd_server_ip.py `find ../debian -name \*.py` if [ $? -gt 0 ] then - echo "Pylint failed, please check your code" + echo "pycodestyle failed, please check your code" exit 1 fi @@ -35,7 +35,7 @@ pylint --disable=R,C,W *.py pylint --disable=R,C,W `find ../debian -name \*.py` if [ $? -gt 0 ] then - echo "Pylint failed, please check your code" + echo "pylint failed, please check your code" exit 1 fi diff --git a/ui/README.md b/ui/README.md index 6e02264402c..b72eedb3389 100644 --- a/ui/README.md +++ b/ui/README.md @@ -2,7 +2,7 @@ A modern role-based progressive CloudStack UI based on VueJS and Ant Design. -![Screenshot](ui/docs/screenshot-dashboard.png) +![Screenshot](docs/screenshot-dashboard.png) ## Getting Started diff --git a/ui/src/components/view/ListView.vue b/ui/src/components/view/ListView.vue index bd191ef926f..35f68b55066 100644 --- a/ui/src/components/view/ListView.vue +++ b/ui/src/components/view/ListView.vue @@ -93,6 +93,12 @@ {{ text }} + {{ text }} @@ -404,7 +410,7 @@ export default { methods: { quickViewEnabled () { return new RegExp(['/vm', '/kubernetes', '/ssh', '/vmgroup', '/affinitygroup', - '/volume', '/snapshot', '/backup', + '/volume', '/snapshot', '/vmsnapshot', '/backup', '/guestnetwork', '/vpc', '/vpncustomergateway', '/template', '/iso', '/project', '/account',