Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
12 changes: 0 additions & 12 deletions scripts/vm/hypervisor/kvm/setup_agent.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fyi - this is removed as installing cloudstack-agent will install aria2 and this script assumes a yum-enabled system that will fail on debian/ubuntu etc.

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
8 changes: 1 addition & 7 deletions server/src/com/cloud/network/IpAddressManagerImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -964,13 +964,7 @@ public PublicIp doInTransaction(TransactionStatus status) throws InsufficientAdd
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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a revert of the code in #2295. Is that functionality now broken?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that PR incorrectly addressed merge conflict. One of the booleans changed from true to false, this fixes that.

}
});
if (ip.getState() != State.Allocated) {
Expand Down
29 changes: 12 additions & 17 deletions test/integration/smoke/test_public_ip_range.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,25 +204,24 @@ def is_ip_in_range(self, start_ip, end_ip, ip_to_test):
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):
"""
Expand Down Expand Up @@ -264,8 +263,6 @@ def base_system_vm(self, services, systemvmtype):
# 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(
Expand Down Expand Up @@ -312,8 +309,6 @@ def base_system_vm(self, services, systemvmtype):
# 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(
Expand Down Expand Up @@ -386,4 +381,4 @@ def test_dedicate_public_ip_range_for_system_vms_ssvm(self):
services,
'secondarystoragevm'
)
return
return
10 changes: 7 additions & 3 deletions test/integration/smoke/test_ssvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,13 @@ def test_02_list_cpvm_vm(self):
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"
)

Expand Down