cloudstack-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CLOUDSTACK-10109) Enable dedication of public IPs to SSVM and CPVM
Date Tue, 09 Jan 2018 19:15:00 GMT

    [ https://issues.apache.org/jira/browse/CLOUDSTACK-10109?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16318982#comment-16318982
] 

ASF GitHub Bot commented on CLOUDSTACK-10109:
---------------------------------------------

rhtyd closed pull request #2394: CLOUDSTACK-10109: Fix regression from PR #2295
URL: https://github.com/apache/cloudstack/pull/2394
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

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 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 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 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);
                 }
             });
             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 @@ 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):
         """
@@ -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(
@@ -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(
@@ -386,4 +381,4 @@ def test_dedicate_public_ip_range_for_system_vms_ssvm(self):
             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 @@ 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"
                 )
 


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> Enable dedication of public IPs to SSVM and CPVM
> ------------------------------------------------
>
>                 Key: CLOUDSTACK-10109
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10109
>             Project: CloudStack
>          Issue Type: New Feature
>      Security Level: Public(Anyone can view this level - this is the default.) 
>            Reporter: Nicolas Vazquez
>            Assignee: Nicolas Vazquez
>         Attachments: public01.png, public02.png, public03.png
>
>
> It is required to dedicate a public IP range for SSVM and CPVM in order to apply firewall
rules to control inbound access.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message