diff --git a/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/provider/SolidFireHostListener.java b/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/provider/SolidFireHostListener.java index 69e1a7995c3..21a7fade52a 100644 --- a/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/provider/SolidFireHostListener.java +++ b/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/provider/SolidFireHostListener.java @@ -74,6 +74,11 @@ public class SolidFireHostListener implements HypervisorHostListener { public boolean hostAdded(long hostId) { HostVO host = _hostDao.findById(hostId); + if (host == null) { + s_logger.error("Failed to add host by SolidFireHostListener as host was not found with id=" + hostId); + return false; + } + SolidFireUtil.hostAddedToOrRemovedFromCluster(hostId, host.getClusterId(), true, SolidFireUtil.PROVIDER_NAME, _clusterDao, _clusterDetailsDao, _storagePoolDao, _storagePoolDetailsDao, _hostDao); diff --git a/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/provider/SolidFireSharedHostListener.java b/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/provider/SolidFireSharedHostListener.java index f88041a3c49..29c39483d11 100644 --- a/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/provider/SolidFireSharedHostListener.java +++ b/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/provider/SolidFireSharedHostListener.java @@ -68,6 +68,11 @@ public class SolidFireSharedHostListener implements HypervisorHostListener { public boolean hostAdded(long hostId) { HostVO host = hostDao.findById(hostId); + if (host == null) { + LOGGER.error("Failed to add host by SolidFireSharedHostListener as host was not found with id=" + hostId); + return false; + } + SolidFireUtil.hostAddedToOrRemovedFromCluster(hostId, host.getClusterId(), true, SolidFireUtil.SHARED_PROVIDER_NAME, clusterDao, clusterDetailsDao, storagePoolDao, storagePoolDetailsDao, hostDao); diff --git a/scripts/vm/hypervisor/kvm/setup_agent.sh b/scripts/vm/hypervisor/kvm/setup_agent.sh index b3c2e0fd280..d55c6adfde2 100755 --- a/scripts/vm/hypervisor/kvm/setup_agent.sh +++ b/scripts/vm/hypervisor/kvm/setup_agent.sh @@ -224,17 +224,5 @@ then setenforce 0 fi -which aria2c -if [ $? -gt 0 ] -then - yum install epel-release -y - yum install aria2 -y - if [ $? -gt 0 ] - then - printf "failed to install aria2" - exit 1 - fi -fi - cloudstack-setup-agent --host=$host --zone=$zone --pod=$pod --cluster=$cluster --guid=$guid $paramters -a > /dev/null #cloud_consoleP_setup $host $zone $pod diff --git a/server/src/com/cloud/network/IpAddressManagerImpl.java b/server/src/com/cloud/network/IpAddressManagerImpl.java index 891dddf66f8..c00359c92f0 100644 --- a/server/src/com/cloud/network/IpAddressManagerImpl.java +++ b/server/src/com/cloud/network/IpAddressManagerImpl.java @@ -964,13 +964,7 @@ public class IpAddressManagerImpl extends ManagerBase implements IpAddressManage VpcVO vpc = _vpcDao.findById(vpcId); displayIp = vpc.isDisplay(); } - PublicIp ip = fetchNewPublicIp(dcId, null, null, owner, VlanType.VirtualNetwork, guestNtwkId, isSourceNat, false, null, false, vpcId, displayIp, false); - IPAddressVO publicIp = ip.ip(); - - markPublicIpAsAllocated(publicIp); - _ipAddressDao.update(publicIp.getId(), publicIp); - - return ip; + return fetchNewPublicIp(dcId, null, null, owner, VlanType.VirtualNetwork, guestNtwkId, isSourceNat, true, null, false, vpcId, displayIp, false); } }); if (ip.getState() != State.Allocated) { diff --git a/test/integration/smoke/test_public_ip_range.py b/test/integration/smoke/test_public_ip_range.py index 624a407dc4a..664fdb4d482 100644 --- a/test/integration/smoke/test_public_ip_range.py +++ b/test/integration/smoke/test_public_ip_range.py @@ -204,25 +204,24 @@ class TestDedicatePublicIPRange(cloudstackTestCase): ip = self.get_ip_as_number(ip_to_test) return start <= ip and ip <= end - def wait_for_system_vm_start(self, domain_id, srv_timeout, srv_sleep, systemvmtype): + def wait_for_system_vm_start(self, domain_id, systemvmtype): """ Wait until system vm is Running """ - timeout = srv_timeout - while True: - list_systemvm_response = list_ssvms( + def checkSystemVMUp(): + response = list_ssvms( self.apiclient, systemvmtype=systemvmtype, domainid=domain_id ) - if isinstance(list_systemvm_response, list): - if list_systemvm_response[0].state == 'Running': - return list_systemvm_response[0].id - if timeout == 0: - raise Exception("List System VM call failed!") + if isinstance(response, list): + if response[0].state == 'Running': + return True, response[0].id + return False, None - time.sleep(srv_sleep) - timeout = timeout - 1 - return None + res, systemvmId = wait_until(3, 100, checkSystemVMUp) + if not res: + raise Exception("Failed to wait for systemvm to be running") + return systemvmId def base_system_vm(self, services, systemvmtype): """ @@ -264,8 +263,6 @@ class TestDedicatePublicIPRange(cloudstackTestCase): # Wait for CPVM to start systemvm_id = self.wait_for_system_vm_start( public_ip_range.vlan.domainid, - self.services["timeout"], - self.services["sleep"], systemvmtype ) self.assertNotEqual( @@ -312,8 +309,6 @@ class TestDedicatePublicIPRange(cloudstackTestCase): # Wait for System VM to start and check System VM public IP systemvm_id = self.wait_for_system_vm_start( domain_id, - self.services["timeout"], - self.services["sleep"], systemvmtype ) list_systemvm_response = list_ssvms( @@ -386,4 +381,4 @@ class TestDedicatePublicIPRange(cloudstackTestCase): services, 'secondarystoragevm' ) - return \ No newline at end of file + return diff --git a/test/integration/smoke/test_ssvm.py b/test/integration/smoke/test_ssvm.py index f20003bf23a..f69761980cd 100644 --- a/test/integration/smoke/test_ssvm.py +++ b/test/integration/smoke/test_ssvm.py @@ -348,9 +348,13 @@ class TestSSVMs(cloudstackTestCase): self.apiclient, physicalnetworkid=listphyntwk[0].id), list) is True): - self.assertEqual( - cpvm.gateway, - iprange.gateway, + cpvmValidGateway = False + for iprange in ipranges_response: + if iprange.gateway == cpvm.gateway: + cpvmValidGateway = True + break + self.assertTrue( + cpvmValidGateway, "Check gateway with that of corresponding ip range" )