You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by sanju1010 <gi...@git.apache.org> on 2016/04/05 14:20:50 UTC

[GitHub] cloudstack pull request: [CLOUDSTACK-9337]Enhance vcenter.py to cr...

GitHub user sanju1010 opened a pull request:

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

    [CLOUDSTACK-9337]Enhance vcenter.py to created data center in vcenter server automatically

    These changes have been made to support vmware deployments in CI. 
    For CI to create cloudstack setup with vmware, it is required to create datacenter, cluster and hosts in vcenter server before adding in cloudstack. Added few methods in vcenter.py to perform these tasks.
    
    Please refer to CLOUDSTACK-9337 for more details.

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

    $ git pull https://github.com/sanju1010/cloudstack vcenter

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

    https://github.com/apache/cloudstack/pull/1464.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 #1464
    
----
commit 8daaa30fc895b2e54bf4adaea01429008c5b368a
Author: sanjeevn <sa...@citrix.com>
Date:   2016-03-21T12:52:08Z

    [CLOUDSTACK-9337]Enhance vcenter.py to created data center in vcenter server automatically
    (Programmatically)

----


---
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-9337]Enhance vcenter.py to cr...

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

    https://github.com/apache/cloudstack/pull/1464#discussion_r58633962
  
    --- Diff: tools/marvin/marvin/lib/vcenter.py ---
    @@ -183,7 +192,157 @@ def get_clusters(self, dc, clus=None):
             """
             pass
     
    +    def create_datacenter(self, dcname=None, service_instance=None, folder=None):
    +        """
    +        Creates a new datacenter with the given name.
    +        Any % (percent) character used in this name parameter must be escaped,
    +        unless it is used to start an escape sequence. Clients may also escape
    +        any other characters in this name parameter.
    +
    +        An entity name must be a non-empty string of
    +        less than 80 characters. The slash (/), backslash (\) and percent (%)
    +        will be escaped using the URL syntax. For example, %2F
    +
    +        This can raise the following exceptions:
    +        vim.fault.DuplicateName
    +        vim.fault.InvalidName
    +        vmodl.fault.NotSupported
    +        vmodl.fault.RuntimeFault
    +        ValueError raised if the name len is > 79
    +        https://github.com/vmware/pyvmomi/blob/master/docs/vim/Folder.rst
    +
    +        Required Privileges
    +        Datacenter.Create
    +
    +        :param folder: Folder object to create DC in. If None it will default to
    +                       rootFolder
    +        :param dcname: Name for the new datacenter.
    +        :param service_instance: ServiceInstance connection to a given vCenter
    +        :return:
    +        """
    +        if len(dcname) > 79:
    +            raise ValueError("The name of the datacenter must be under "
    +                             "80 characters.")
    +
    +        if folder is None:
    +            folder = self.service_instance.content.rootFolder
    +
    +        if folder is not None and isinstance(folder, vim.Folder):
    +            dc_moref = folder.CreateDatacenter(name=dcname)
    --- End diff --
    
    Hello @sanju1010 
    Is it necessary to double check if folder is not None here? Also you mentioned some restrictions for the dcname, shouldnt they also raise and ValueError?


---
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-9337]Enhance vcenter.py to cr...

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

    https://github.com/apache/cloudstack/pull/1464#issuecomment-216226567
  
    @sanju1010 how can we test this
    
    tag:vmware-pickup


---
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-9337]Enhance vcenter.py to cr...

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

    https://github.com/apache/cloudstack/pull/1464#issuecomment-206458563
  
    I don't have the ability to test vcenter.  Is there anyone else who has the ability to test vcenter who can post the test results of a CI run?


---
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 issue #1464: [CLOUDSTACK-9337]Enhance vcenter.py to create data c...

Posted by sanju1010 <gi...@git.apache.org>.
Github user sanju1010 commented on the issue:

    https://github.com/apache/cloudstack/pull/1464
  
    @swill , BVT results are clean. Can we push this to master? This will not have any impact on acs master stablity.


---
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-9337]Enhance vcenter.py to cr...

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

    https://github.com/apache/cloudstack/pull/1464#discussion_r58739597
  
    --- Diff: tools/marvin/marvin/lib/vcenter.py ---
    @@ -183,7 +192,157 @@ def get_clusters(self, dc, clus=None):
             """
             pass
     
    +    def create_datacenter(self, dcname=None, service_instance=None, folder=None):
    +        """
    +        Creates a new datacenter with the given name.
    +        Any % (percent) character used in this name parameter must be escaped,
    +        unless it is used to start an escape sequence. Clients may also escape
    +        any other characters in this name parameter.
    +
    +        An entity name must be a non-empty string of
    +        less than 80 characters. The slash (/), backslash (\) and percent (%)
    +        will be escaped using the URL syntax. For example, %2F
    +
    +        This can raise the following exceptions:
    +        vim.fault.DuplicateName
    +        vim.fault.InvalidName
    +        vmodl.fault.NotSupported
    +        vmodl.fault.RuntimeFault
    +        ValueError raised if the name len is > 79
    +        https://github.com/vmware/pyvmomi/blob/master/docs/vim/Folder.rst
    +
    +        Required Privileges
    +        Datacenter.Create
    +
    +        :param folder: Folder object to create DC in. If None it will default to
    +                       rootFolder
    +        :param dcname: Name for the new datacenter.
    +        :param service_instance: ServiceInstance connection to a given vCenter
    +        :return:
    +        """
    +        if len(dcname) > 79:
    +            raise ValueError("The name of the datacenter must be under "
    +                             "80 characters.")
    +
    +        if folder is None:
    +            folder = self.service_instance.content.rootFolder
    +
    +        if folder is not None and isinstance(folder, vim.Folder):
    +            dc_moref = folder.CreateDatacenter(name=dcname)
    --- End diff --
    
    got it. The code looks good, those were the only doubts I had. I would just use a Semaphore in line 317, but sleep an pool is not that bad also.
    
    The code seems fine, but tests are needed.


---
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-9337]Enhance vcenter.py to cr...

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

    https://github.com/apache/cloudstack/pull/1464#discussion_r58660462
  
    --- Diff: tools/marvin/marvin/lib/vcenter.py ---
    @@ -183,7 +192,157 @@ def get_clusters(self, dc, clus=None):
             """
             pass
     
    +    def create_datacenter(self, dcname=None, service_instance=None, folder=None):
    +        """
    +        Creates a new datacenter with the given name.
    +        Any % (percent) character used in this name parameter must be escaped,
    +        unless it is used to start an escape sequence. Clients may also escape
    +        any other characters in this name parameter.
    +
    +        An entity name must be a non-empty string of
    +        less than 80 characters. The slash (/), backslash (\) and percent (%)
    +        will be escaped using the URL syntax. For example, %2F
    +
    +        This can raise the following exceptions:
    +        vim.fault.DuplicateName
    +        vim.fault.InvalidName
    +        vmodl.fault.NotSupported
    +        vmodl.fault.RuntimeFault
    +        ValueError raised if the name len is > 79
    +        https://github.com/vmware/pyvmomi/blob/master/docs/vim/Folder.rst
    +
    +        Required Privileges
    +        Datacenter.Create
    +
    +        :param folder: Folder object to create DC in. If None it will default to
    +                       rootFolder
    +        :param dcname: Name for the new datacenter.
    +        :param service_instance: ServiceInstance connection to a given vCenter
    +        :return:
    +        """
    +        if len(dcname) > 79:
    +            raise ValueError("The name of the datacenter must be under "
    +                             "80 characters.")
    +
    +        if folder is None:
    +            folder = self.service_instance.content.rootFolder
    +
    +        if folder is not None and isinstance(folder, vim.Folder):
    +            dc_moref = folder.CreateDatacenter(name=dcname)
    --- End diff --
    
    @alexandrelimassantana , CreateDatacenter will through appropriate exception if the dcname is not proper. Double check for folder is to make sure that we get the rootFolder object if folder is None.


---
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 issue #1464: [CLOUDSTACK-9337]Enhance vcenter.py to create data c...

Posted by karuturi <gi...@git.apache.org>.
Github user karuturi commented on the issue:

    https://github.com/apache/cloudstack/pull/1464
  
    \U0001f44d merging this now.


---
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-9337]Enhance vcenter.py to cr...

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

    https://github.com/apache/cloudstack/pull/1464#issuecomment-212756206
  
    These changes will not have any impact on cloudstack code since it is purely to orchestrate the vcenter Server to create datacenter->cluster->hosts. Can we merge this without waiting for CI to run?


---
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-9337]Enhance vcenter.py to cr...

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

    https://github.com/apache/cloudstack/pull/1464#issuecomment-212904531
  
    I am fine with not running CI on this one.  It would be nice if someone could post a screenshot or something to show that the code behaves as expected.
    
    We are missing 1 LGTM, otherwise I think we are in pretty good shape.


---
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-9337]Enhance vcenter.py to cr...

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

    https://github.com/apache/cloudstack/pull/1464#issuecomment-206273155
  
    Did a code walk through . LGTM . 
    Get the CI result for this PR


---
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-9337]Enhance vcenter.py to cr...

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

    https://github.com/apache/cloudstack/pull/1464#issuecomment-212853751
  
    @shwetaag @swill As I understand from @sanju1010 comment, the script is used to automate creation of dc, cluster and hosts in vCenter. The setup created can then be used to run Cloudstack tests for VMware. I don't see the need to run CI on this.


---
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-9337]Enhance vcenter.py to cr...

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

    https://github.com/apache/cloudstack/pull/1464#issuecomment-218810586
  
    anyone able to pick this up for validation and giving me a final code review???


---
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 #1464: [CLOUDSTACK-9337]Enhance vcenter.py to create...

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

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


---
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-9337]Enhance vcenter.py to cr...

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

    https://github.com/apache/cloudstack/pull/1464#issuecomment-220739360
  
    @sanju1010 I don't know what to do with this one.  I don't have any verification that this PR works, so I am not sure what information I am supposed to be going on to be confident in merging 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 issue #1464: [CLOUDSTACK-9337]Enhance vcenter.py to create data c...

Posted by bvbharatk <gi...@git.apache.org>.
Github user bvbharatk commented on the issue:

    https://github.com/apache/cloudstack/pull/1464
  
    ### ACS CI BVT Run
     **Sumarry:**
     Build Number 165
     Hypervisor xenserver
     NetworkType Advanced
     Passed=73
     Failed=0
     Skipped=3
    
    _Link to logs Folder (search by build_no):_ https://www.dropbox.com/sh/yj3wnzbceo9uef2/AAB6u-Iap-xztdm6jHX9SjPja?dl=0
    
    
    **Failed tests:**
    
    **Skipped tests:**
    test_vm_nic_adapter_vmxnet3
    test_static_role_account_acls
    test_deploy_vgpu_enabled_vm
    
    **Passed test suits:**
    test_deploy_vm_with_userdata.py
    test_affinity_groups_projects.py
    test_portable_publicip.py
    test_vpc_vpn.py
    test_over_provisioning.py
    test_global_settings.py
    test_scale_vm.py
    test_service_offerings.py
    test_routers_iptables_default_policy.py
    test_routers.py
    test_reset_vm_on_reboot.py
    test_snapshots.py
    test_deploy_vms_with_varied_deploymentplanners.py
    test_login.py
    test_list_ids_parameter.py
    test_public_ip_range.py
    test_multipleips_per_nic.py
    test_regions.py
    test_affinity_groups.py
    test_network_acl.py
    test_pvlan.py
    test_volumes.py
    test_nic.py
    test_deploy_vm_root_resize.py
    test_resource_detail.py
    test_secondary_storage.py
    test_vm_life_cycle.py
    test_disk_offerings.py


---
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 issue #1464: [CLOUDSTACK-9337]Enhance vcenter.py to create data c...

Posted by swill <gi...@git.apache.org>.
Github user swill commented on the issue:

    https://github.com/apache/cloudstack/pull/1464
  
    Master is frozen in prep for the 4.9 release. This will have to wait for 4.10. 


---
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-9337]Enhance vcenter.py to cr...

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

    https://github.com/apache/cloudstack/pull/1464#issuecomment-219540711
  
    This one is pretty much ready, but without verification that it works and without the required code reviews I can't really justify merging it.  I just don't know if works and does not break anything...  Not sure what to do with this one...  4.9 freeze is VERY close right now, so time is of the essence...


---
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.
---