You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by wilderrodrigues <gi...@git.apache.org> on 2015/10/28 17:15:33 UTC

[GitHub] cloudstack pull request: CLOUDSTACK-8957 - VR password server feat...

GitHub user wilderrodrigues opened a pull request:

    https://github.com/apache/cloudstack/pull/998

    CLOUDSTACK-8957 - VR password server feature is broken

    This PR implements the update of the password as it use to be done with the bash file, but using the Python code for it.
    
    A new integration test was added in order to cover the fix. The test can be found at component/test_password_server.py and does the following:
    
    * Creates an Account
    * Creates a Service Offering
    * Creates a Network Offering
    * Creates a Network
    * Creates two Virtual Machines
    * Creates two FW rules
    * Creates two PF rules
    * SSH into each VM and checks the default routes (by pinging 8.8.8.8)
    * SSH to the host and executes a command in the router to check the password-[gateway] file
      - The file is under /var/cache/cloud/passwords-[gateway]
    
    The [gateway] is replaced by the gateway from each virtual machine NIC.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/ekholabs/cloudstack fix/vr_passwd_server-CLOUDSTACK-8957

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cloudstack/pull/998.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #998
    
----
commit ea132cc4789e3c2161a0618ac02e7a68a8d67aed
Author: Wilder Rodrigues <wr...@schubergphilis.com>
Date:   2015-10-27T12:31:31Z

    CLOUDSTACK-8957 - Implement password server in configure.py

commit 92ccd45db5dd0aa175d7702e2723af4d01528b8b
Author: Wilder Rodrigues <wr...@schubergphilis.com>
Date:   2015-10-28T07:43:26Z

    CLOUDSTACK-8957 - Make some improvements in the way the process is checked
    
      - Fix import of CsProcess module

commit ac3e352125261fc34527a56028998b644371e2d7
Author: Wilder Rodrigues <wr...@schubergphilis.com>
Date:   2015-10-28T15:31:04Z

    CLOUDSTACK-8957 - Add integration test that cheks if the password file is present and not empty

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8957 - VR password server feat...

Posted by wilderrodrigues <gi...@git.apache.org>.
Github user wilderrodrigues commented on the pull request:

    https://github.com/apache/cloudstack/pull/998#issuecomment-151906311
  
    Got 2 red checks. Will have a look why.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8957 - VR password server feat...

Posted by bhaisaab <gi...@git.apache.org>.
Github user bhaisaab commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/998#discussion_r43282110
  
    --- Diff: systemvm/patches/debian/config/opt/cloud/bin/configure.py ---
    @@ -41,27 +41,37 @@
     from cs.CsMonitor import CsMonitor
     from cs.CsLoadBalancer import CsLoadBalancer
     from cs.CsConfig import CsConfig
    +from cs.CsProcess import CsProcess
     
     
     class CsPassword(CsDataBag):
    -    """
    -      Update the password cache
    -
    -      A stupid step really as we should just rewrite the password server to
    -      use the databag
    -    """
    -    cache = "/var/cache/cloud/passwords"
    -
    +    
    +    TOKEN_FILE="/tmp/passwdsrvrtoken"
    +    
         def process(self):
    -        file = CsFile(self.cache)
             for item in self.dbag:
                 if item == "id":
                     continue
    -            self.__update(file, item, self.dbag[item])
    -        file.commit()
    +            self.__update(item, self.dbag[item])
     
    -    def __update(self, file, ip, password):
    -        file.search("%s=" % ip, "%s=%s" % (ip, password))
    +    def __update(self, vm_ip, password):
    +        token = ""
    +        try:
    +            tokenFile = open(self.TOKEN_FILE)
    +            token = tokenFile.read()
    +        except IOError:
    +            logging.debug("File %s does not exist" % self.TOKEN_FILE)
    +
    +        ips_cmd = "ip addr show | grep inet | awk '{print $2}'"
    +        ips = CsHelper.execute(ips_cmd)
    +        for ip in ips:
    +            server_ip = ip.split('/')[0]
    +            proc = CsProcess(['/opt/cloud/bin/passwd_server_ip.py', server_ip])
    +            if proc.find():
    +                update_command = 'curl --header "DomU_Request: save_password" "http://{SERVER_IP}:8080/" -F "ip={VM_IP}" -F "password={PASSWORD}" ' \
    --- End diff --
    
    while this works, since we are using python; we can simply make a HTTP call as well using requests or urllib etc?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8957 - VR password server feat...

Posted by bhaisaab <gi...@git.apache.org>.
Github user bhaisaab commented on the pull request:

    https://github.com/apache/cloudstack/pull/998#issuecomment-151904579
  
    (forgot to mention, just reviewed code but yet to test it)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8957 - VR password server feat...

Posted by wilderrodrigues <gi...@git.apache.org>.
Github user wilderrodrigues commented on the pull request:

    https://github.com/apache/cloudstack/pull/998#issuecomment-151907240
  
    @bhaisaab 
    
    Squashed and pushed again.
    
    Cheers,
    Wilder


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8957 - VR password server feat...

Posted by wilderrodrigues <gi...@git.apache.org>.
Github user wilderrodrigues commented on the pull request:

    https://github.com/apache/cloudstack/pull/998#issuecomment-151900260
  
    Ping @remibergsma @borisroman @wido @miguelaferreira @DaanHoogland @bhaisaab @karuturi @NuxRo 
    
    Could you please have a look at this PR? I already have the results for the new tests that was added, but will run more tests overnight.
    
    Test Results
    * Management Server + MySQL on CentOS 7.1
    * One KVM host on CentOS 7.1
    * ACS Agent + Common RPMs built from source
    
    ```
    Check the password file in the Router VM ... === TestName: test_isolate_network_password_server | Status : SUCCESS ===
    ok
    
    ----------------------------------------------------------------------
    Ran 1 test in 423.831s
    
    OK
    /tmp//MarvinLogs/test_password_server_1ANC53/results.txt (END)
    ```
    



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8957 - VR password server feat...

Posted by wilderrodrigues <gi...@git.apache.org>.
Github user wilderrodrigues commented on the pull request:

    https://github.com/apache/cloudstack/pull/998#issuecomment-151974900
  
    Ping @remibergsma @DaanHoogland @karuturi @miguelaferreira 
    
    Test results
    
    * Hardware required: false
    * Management Server + MySQL on CentOS 7.1
    * One KVM host on CentOS 7.1
    * ACS Agent + Common built from source
    
    ```
    Test for port forwarding on source NAT ... === TestName: test_01_port_fwd_on_src_nat | Status : SUCCESS ===
    ok
    Test for port forwarding on non source NAT ... === TestName: test_02_port_fwd_on_non_src_nat | Status : SUCCESS ===
    ok
    Test for reboot router ... === TestName: test_reboot_router | Status : SUCCESS ===
    ok
    Test for Router rules for network rules on acquired public IP ... === TestName: test_network_rules_acquired_public_ip_1_static_nat_rule | Status : FAILED ===
    FAIL
    Test for Router rules for network rules on acquired public IP ... === TestName: test_network_rules_acquired_public_ip_2_nat_rule | Status : FAILED ===
    FAIL
    Test for Router rules for network rules on acquired public IP ... === TestName: test_network_rules_acquired_public_ip_3_Load_Balancer_Rule | Status : FAILED ===
    FAIL
    Create a redundant VPC with two networks with two VMs in each network ... === TestName: test_01_create_redundant_VPC_2tiers_4VMs_4IPs_4PF_ACL | Status : SUCCESS ===
    ok
    Create a redundant VPC with two networks with two VMs in each network and check default routes ... === TestName: test_02_redundant_VPC_default_routes | Status : SUCCESS ===
    ok
    Test iptables default INPUT/FORWARD policy on RouterVM ... === TestName: test_02_routervm_iptables_policies | Status : SUCCESS ===
    ok
    Test iptables default INPUT/FORWARD policies on VPC router ... === TestName: test_01_single_VPC_iptables_policies | Status : SUCCESS ===
    ok
    Create a VPC with two networks with one VM in each network and test nics after destroy ... === TestName: test_01_VPC_nics_after_destroy | Status : SUCCESS ===
    ok
    Create a VPC with two networks with one VM in each network and test default routes ... === TestName: test_02_VPC_default_routes | Status : SUCCESS ===
    ok
    Test to verify access to loadbalancer haproxy admin stats page ... === TestName: test02_internallb_haproxy_stats_on_all_interfaces | Status : SUCCESS ===
    ok
    Test create, assign, remove of an Internal LB with roundrobin http traffic to 3 vm's ... === TestName: test_01_internallb_roundrobin_1VPC_3VM_HTTP_port80 | Status : SUCCESS ===
    ok
    Stop existing router, add a PF rule and check we can access the VM ... === TestName: test_isolate_network_FW_PF_default_routes | Status : SUCCESS ===
    ok
    Test redundant router internals ... === TestName: test_RVR_Network_FW_PF_SSH_default_routes | Status : SUCCESS ===
    ok
    Test SSVM Internals ... === TestName: test_03_ssvm_internals | Status : SUCCESS ===
    ok
    Test CPVM Internals ... === TestName: test_04_cpvm_internals | Status : SUCCESS ===
    ok
    Test stop SSVM ... === TestName: test_05_stop_ssvm | Status : SUCCESS ===
    ok
    Test stop CPVM ... === TestName: test_06_stop_cpvm | Status : SUCCESS ===
    ok
    Test reboot SSVM ... === TestName: test_07_reboot_ssvm | Status : SUCCESS ===
    ok
    Test reboot CPVM ... === TestName: test_08_reboot_cpvm | Status : SUCCESS ===
    ok
    Test destroy SSVM ... === TestName: test_09_destroy_ssvm | Status : SUCCESS ===
    ok
    Test destroy CPVM ... === TestName: test_10_destroy_cpvm | Status : SUCCESS ===
    ok
    Test to create Load balancing rule with source NAT ... === TestName: test_01_create_lb_rule_src_nat | Status : SUCCESS ===
    ok
    Test to create Load balancing rule with non source NAT ... === TestName: test_02_create_lb_rule_non_nat | Status : SUCCESS ===
    ok
    Test for assign & removing load balancing rule ... === TestName: test_assign_and_removal_lb | Status : SUCCESS ===
    ok
    ```
    
    Three tests failed, but that was expected since the fix is in the PR #989 
    
    I will also run the [hardware require=true] tests.
    
    Cheers,
    Wilder


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8957 - VR password server feat...

Posted by wilderrodrigues <gi...@git.apache.org>.
Github user wilderrodrigues commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/998#discussion_r43352356
  
    --- Diff: systemvm/patches/debian/config/opt/cloud/bin/configure.py ---
    @@ -41,27 +41,37 @@
     from cs.CsMonitor import CsMonitor
     from cs.CsLoadBalancer import CsLoadBalancer
     from cs.CsConfig import CsConfig
    +from cs.CsProcess import CsProcess
     
     
     class CsPassword(CsDataBag):
    -    """
    -      Update the password cache
    -
    -      A stupid step really as we should just rewrite the password server to
    -      use the databag
    -    """
    -    cache = "/var/cache/cloud/passwords"
    -
    +    
    +    TOKEN_FILE="/tmp/passwdsrvrtoken"
    +    
         def process(self):
    -        file = CsFile(self.cache)
             for item in self.dbag:
                 if item == "id":
                     continue
    -            self.__update(file, item, self.dbag[item])
    -        file.commit()
    +            self.__update(item, self.dbag[item])
     
    -    def __update(self, file, ip, password):
    -        file.search("%s=" % ip, "%s=%s" % (ip, password))
    +    def __update(self, vm_ip, password):
    +        token = ""
    +        try:
    +            tokenFile = open(self.TOKEN_FILE)
    +            token = tokenFile.read()
    +        except IOError:
    +            logging.debug("File %s does not exist" % self.TOKEN_FILE)
    +
    +        ips_cmd = "ip addr show | grep inet | awk '{print $2}'"
    +        ips = CsHelper.execute(ips_cmd)
    +        for ip in ips:
    +            server_ip = ip.split('/')[0]
    +            proc = CsProcess(['/opt/cloud/bin/passwd_server_ip.py', server_ip])
    +            if proc.find():
    +                update_command = 'curl --header "DomU_Request: save_password" "http://{SERVER_IP}:8080/" -F "ip={VM_IP}" -F "password={PASSWORD}" ' \
    --- End diff --
    
    Hi @bhaisaab,
    
    I will create an improvement ticket to tackle your point. After 4.6 we are planning to rewrite it in a proper way and get rid of all those things that mixes bash/python code. So, adding few lines now is not going to add to the whole picture as they will also been removed afterwards.
    
    My personal goal for 4.7/5.0, which is also the goal of my colleagues, is to rip ou the whole Python code and also the bash scripts - no longer used - from the ACS.
    
    It cannot be done right in a few lines. It would be like a drop in an ocean.
    
    Cheers,
    Wilder


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8957 - VR password server feat...

Posted by bhaisaab <gi...@git.apache.org>.
Github user bhaisaab commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/998#discussion_r43349249
  
    --- Diff: systemvm/patches/debian/config/opt/cloud/bin/configure.py ---
    @@ -41,27 +41,37 @@
     from cs.CsMonitor import CsMonitor
     from cs.CsLoadBalancer import CsLoadBalancer
     from cs.CsConfig import CsConfig
    +from cs.CsProcess import CsProcess
     
     
     class CsPassword(CsDataBag):
    -    """
    -      Update the password cache
    -
    -      A stupid step really as we should just rewrite the password server to
    -      use the databag
    -    """
    -    cache = "/var/cache/cloud/passwords"
    -
    +    
    +    TOKEN_FILE="/tmp/passwdsrvrtoken"
    +    
         def process(self):
    -        file = CsFile(self.cache)
             for item in self.dbag:
                 if item == "id":
                     continue
    -            self.__update(file, item, self.dbag[item])
    -        file.commit()
    +            self.__update(item, self.dbag[item])
     
    -    def __update(self, file, ip, password):
    -        file.search("%s=" % ip, "%s=%s" % (ip, password))
    +    def __update(self, vm_ip, password):
    +        token = ""
    +        try:
    +            tokenFile = open(self.TOKEN_FILE)
    +            token = tokenFile.read()
    +        except IOError:
    +            logging.debug("File %s does not exist" % self.TOKEN_FILE)
    +
    +        ips_cmd = "ip addr show | grep inet | awk '{print $2}'"
    +        ips = CsHelper.execute(ips_cmd)
    +        for ip in ips:
    +            server_ip = ip.split('/')[0]
    +            proc = CsProcess(['/opt/cloud/bin/passwd_server_ip.py', server_ip])
    +            if proc.find():
    +                update_command = 'curl --header "DomU_Request: save_password" "http://{SERVER_IP}:8080/" -F "ip={VM_IP}" -F "password={PASSWORD}" ' \
    --- End diff --
    
    While it fixes the issue, if it's not too much of a pain let's do it right otherwise it gets difficult to change in future as an enhancement.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8957 - VR password server feat...

Posted by wilderrodrigues <gi...@git.apache.org>.
Github user wilderrodrigues commented on the pull request:

    https://github.com/apache/cloudstack/pull/998#issuecomment-152087954
  
    Ping @remibergsma @karuturi @miguelaferreira
    
    Test results
    
    * Hardware required: false
    * Management Server + MySQL on CentOS 7.1
    * One KVM host on CentOS 7.1
    * ACS Agent + Common built from source
    
    ```
    Test start/stop of router after addition of one guest network ... === TestName: test_01_start_stop_router_after_addition_of_one_guest_network | Status : SUCCESS ===
    ok
    Test reboot of router after addition of one guest network ... === TestName: test_02_reboot_router_after_addition_of_one_guest_network | Status : SUCCESS ===
    ok
    Test to change service offering of router after addition of one guest network ... === TestName: test_04_chg_srv_off_router_after_addition_of_one_guest_network | Status : SUCCESS ===
    ok
    Test destroy of router after addition of one guest network ... === TestName: test_05_destroy_router_after_addition_of_one_guest_network | Status : SUCCESS ===
    ok
    Test to stop and start router after creation of VPC ... === TestName: test_01_stop_start_router_after_creating_vpc | Status : SUCCESS ===
    ok
    Test to reboot the router after creating a VPC ... === TestName: test_02_reboot_router_after_creating_vpc | Status : SUCCESS ===
    ok
    Tests to change service offering of the Router after ... === TestName: test_04_change_service_offerring_vpc | Status : SUCCESS ===
    ok
    Test to destroy the router after creating a VPC ... === TestName: test_05_destroy_router_after_creating_vpc | Status : SUCCESS ===
    ok
    Test router internal advanced zone ... === TestName: test_02_router_internal_adv | Status : SUCCESS ===
    ok
    Test restart network ... === TestName: test_03_restart_network_cleanup | Status : SUCCESS ===
    ok
    Test router basic setup ... === TestName: test_05_router_basic | Status : SUCCESS ===
    ok
    Test router advanced setup ... === TestName: test_06_router_advanced | Status : SUCCESS ===
    ok
    Test stop router ... === TestName: test_07_stop_router | Status : SUCCESS ===
    ok
    Test start router ... === TestName: test_08_start_router | Status : SUCCESS ===
    ok
    Test reboot router ... === TestName: test_09_reboot_router | Status : SUCCESS ===
    ok
    test_privategw_acl (integration.smoke.test_privategw_acl.TestPrivateGwACL) ... === TestName: test_privategw_acl | Status : SUCCESS ===
    ok
    Test reset virtual machine on reboot ... === TestName: test_01_reset_vm_on_reboot | Status : SUCCESS ===
    ok
    Test advanced zone virtual router ... === TestName: test_advZoneVirtualRouter | Status : SUCCESS ===
    ok
    Test Deploy Virtual Machine ... === TestName: test_deploy_vm | Status : SUCCESS ===
    ok
    Test Multiple Deploy Virtual Machine ... === TestName: test_deploy_vm_multiple | Status : SUCCESS ===
    ok
    Test Stop Virtual Machine ... === TestName: test_01_stop_vm | Status : SUCCESS ===
    ok
    Test Start Virtual Machine ... === TestName: test_02_start_vm | Status : SUCCESS ===
    ok
    Test Reboot Virtual Machine ... === TestName: test_03_reboot_vm | Status : SUCCESS ===
    ok
    Test destroy Virtual Machine ... === TestName: test_06_destroy_vm | Status : SUCCESS ===
    ok
    Test recover Virtual Machine ... === TestName: test_07_restore_vm | Status : SUCCESS ===
    ok
    Test migrate VM ... SKIP: At least two hosts should be present in the zone for migration
    Test destroy(expunge) Virtual Machine ... === TestName: test_09_expunge_vm | Status : SUCCESS ===
    ok
    Test Remote Access VPN in VPC ... === TestName: test_vpc_remote_access_vpn | Status : SUCCESS ===
    ok
    Test VPN in VPC ... === TestName: test_vpc_site2site_vpn | Status : SUCCESS ===
    ok
    Test to create service offering ... === TestName: test_01_create_service_offering | Status : SUCCESS ===
    ok
    Test to update existing service offering ... === TestName: test_02_edit_service_offering | Status : SUCCESS ===
    ok
    Test to delete service offering ... === TestName: test_03_delete_service_offering | Status : SUCCESS ===
    ok
    Test create VPC offering ... === TestName: test_01_create_vpc_offering | Status : SUCCESS ===
    ok
    Test VPC offering without load balancing service ... === TestName: test_03_vpc_off_without_lb | Status : SUCCESS ===
    ok
    Test VPC offering without static NAT service ... === TestName: test_04_vpc_off_without_static_nat | Status : SUCCESS ===
    ok
    Test VPC offering without port forwarding service ... === TestName: test_05_vpc_off_without_pf | Status : SUCCESS ===
    ok
    Test VPC offering with invalid services ... === TestName: test_06_vpc_off_invalid_services | Status : SUCCESS ===
    ok
    Test update VPC offering ... === TestName: test_07_update_vpc_off | Status : SUCCESS ===
    ok
    Test list VPC offering ... === TestName: test_08_list_vpc_off | Status : SUCCESS ===
    ok
    test_09_create_redundant_vpc_offering (integration.component.test_vpc_offerings.TestVPCOffering) ... === TestName: test_09_create_redundant_vpc_offering | Status : SUCCESS ===
    ok
    
    ----------------------------------------------------------------------
    Ran 40 tests in 8159.965s
    
    OK (SKIP=1)
    (END)
    ```
    
    I will rebase and push it again in an attempt to get Travis green.
    
    Cheers,
    Wilder


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8957 - VR password server feat...

Posted by bhaisaab <gi...@git.apache.org>.
Github user bhaisaab commented on the pull request:

    https://github.com/apache/cloudstack/pull/998#issuecomment-151904440
  
    LGTM, you may squash the commits as it's a single logical fix


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8957 - VR password server feat...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/cloudstack/pull/998


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8957 - VR password server feat...

Posted by remibergsma <gi...@git.apache.org>.
Github user remibergsma commented on the pull request:

    https://github.com/apache/cloudstack/pull/998#issuecomment-152106800
  
    Will merge when Travis and Jenkins are green.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8957 - VR password server feat...

Posted by wilderrodrigues <gi...@git.apache.org>.
Github user wilderrodrigues commented on the pull request:

    https://github.com/apache/cloudstack/pull/998#issuecomment-151928213
  
    Travis failed due to a timeout:
    
    ![image](https://cloud.githubusercontent.com/assets/5129209/10797761/6835b74c-7da4-11e5-9fd6-080b807739f1.png)



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8957 - VR password server feat...

Posted by wilderrodrigues <gi...@git.apache.org>.
Github user wilderrodrigues commented on the pull request:

    https://github.com/apache/cloudstack/pull/998#issuecomment-151958257
  
    Nice one, @borisroman. Thanks for the tests!
    
    Cheers,
    Wilder


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8957 - VR password server feat...

Posted by wilderrodrigues <gi...@git.apache.org>.
Github user wilderrodrigues commented on the pull request:

    https://github.com/apache/cloudstack/pull/998#issuecomment-151906835
  
    Ping @bhaisaab @DaanHoogland @remibergsma @miguelaferreira 
    
    Does anyone know why this error happened? Read it but I can't take much of it. It has nothing to do with the PR content.
    
    ![image](https://cloud.githubusercontent.com/assets/5129209/10795936/43afbba0-7d9c-11e5-88a8-3622c5bc5ba8.png)



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8957 - VR password server feat...

Posted by wilderrodrigues <gi...@git.apache.org>.
Github user wilderrodrigues commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/998#discussion_r43290720
  
    --- Diff: systemvm/patches/debian/config/opt/cloud/bin/configure.py ---
    @@ -41,27 +41,37 @@
     from cs.CsMonitor import CsMonitor
     from cs.CsLoadBalancer import CsLoadBalancer
     from cs.CsConfig import CsConfig
    +from cs.CsProcess import CsProcess
     
     
     class CsPassword(CsDataBag):
    -    """
    -      Update the password cache
    -
    -      A stupid step really as we should just rewrite the password server to
    -      use the databag
    -    """
    -    cache = "/var/cache/cloud/passwords"
    -
    +    
    +    TOKEN_FILE="/tmp/passwdsrvrtoken"
    +    
         def process(self):
    -        file = CsFile(self.cache)
             for item in self.dbag:
                 if item == "id":
                     continue
    -            self.__update(file, item, self.dbag[item])
    -        file.commit()
    +            self.__update(item, self.dbag[item])
     
    -    def __update(self, file, ip, password):
    -        file.search("%s=" % ip, "%s=%s" % (ip, password))
    +    def __update(self, vm_ip, password):
    +        token = ""
    +        try:
    +            tokenFile = open(self.TOKEN_FILE)
    +            token = tokenFile.read()
    +        except IOError:
    +            logging.debug("File %s does not exist" % self.TOKEN_FILE)
    +
    +        ips_cmd = "ip addr show | grep inet | awk '{print $2}'"
    +        ips = CsHelper.execute(ips_cmd)
    +        for ip in ips:
    +            server_ip = ip.split('/')[0]
    +            proc = CsProcess(['/opt/cloud/bin/passwd_server_ip.py', server_ip])
    +            if proc.find():
    +                update_command = 'curl --header "DomU_Request: save_password" "http://{SERVER_IP}:8080/" -F "ip={VM_IP}" -F "password={PASSWORD}" ' \
    --- End diff --
    
    Good point, @bhaisaab .
    
    I don't have the energy to update it now, but will do it tomorrow. I just used the same stuff we had in the previous passwd bash file, but it makes more sense to Pythonise the whole thing. :)
    
    Cheers,
    Wilder


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8957 - VR password server feat...

Posted by borisroman <gi...@git.apache.org>.
Github user borisroman commented on the pull request:

    https://github.com/apache/cloudstack/pull/998#issuecomment-151957189
  
    @wilderrodrigues @remibergsma LGTM :+1: 
    
    Tested VM password manually => working!
    
    ```
    nosetests --with-marvin --marvin-config=/data/shared/marvin/mct-zone1-kvm1-basic.cfg -s -a tags=basic,required_hardware=false smoke/test_vm_life_cycle.py
    ```
    ```
    cat /tmp/MarvinLogs/test_vm_life_cycle_5PP3X0/results.txt 
    Test Deploy Virtual Machine ... === TestName: test_deploy_vm | Status : SUCCESS ===
    ok
    Test Multiple Deploy Virtual Machine ... === TestName: test_deploy_vm_multiple | Status : SUCCESS ===
    ok
    Test Stop Virtual Machine ... === TestName: test_01_stop_vm | Status : SUCCESS ===
    ok
    Test Start Virtual Machine ... === TestName: test_02_start_vm | Status : SUCCESS ===
    ok
    Test Reboot Virtual Machine ... === TestName: test_03_reboot_vm | Status : SUCCESS ===
    ok
    Test destroy Virtual Machine ... === TestName: test_06_destroy_vm | Status : SUCCESS ===
    ok
    Test recover Virtual Machine ... === TestName: test_07_restore_vm | Status : SUCCESS ===
    ok
    Test migrate VM ... SKIP: At least two hosts should be present in the zone for migration
    Test destroy(expunge) Virtual Machine ... === TestName: test_09_expunge_vm | Status : SUCCESS ===
    ok
    
    ----------------------------------------------------------------------
    Ran 9 tests in 572.101s
    
    OK (SKIP=1)
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---