Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

Commit

Permalink
support for flex allocation model in org vdc creation
Browse files Browse the repository at this point in the history
  • Loading branch information
rana-Alotaibi1 committed Dec 8, 2020
1 parent 63522ff commit 88b7fb7
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions pyvcloud/vcd/org.py
Original file line number Diff line number Diff line change
Expand Up @@ -1470,7 +1470,9 @@ def create_org_vdc(self,
uses_fast_provisioning=None,
over_commit_allowed=None,
vm_discovery_enabled=None,
is_enabled=True):
is_enabled=True,
is_elastic=False,
include_memory_overhead=False):
"""Create an Organization VDC in the current organization.
:param str vdc_name: name of the new org vdc.
Expand All @@ -1479,7 +1481,7 @@ def create_org_vdc(self,
:param str description: description of the new org vdc.
:param str allocation_model: allocation model used by this vdc.
Accepted values are 'AllocationVApp', 'AllocationPool' or
'ReservationPool'.
'ReservationPool' or 'Flex'.
:param str cpu_units: unit for compute capacity allocated to this vdc.
Accepted values are 'MHz' or 'GHz'.
:param int cpu_allocated: capacity that is committed to be available.
Expand Down Expand Up @@ -1530,6 +1532,8 @@ def create_org_vdc(self,
is enabled for resource pools backing this vdc.
:param bool is_enabled: True, if this vdc is enabled for use by the
organization users.
:param bool is_elastic: Defaults to False, True to enable elasticity in Flex allocation model
:param bool include_memory_overhead: Defaults to False, True to include memory overhead in Flex allocation model
:return: an object containing EntityType.VDC XML data describing the
new VDC.
Expand Down Expand Up @@ -1589,6 +1593,10 @@ def create_org_vdc(self,
params.append(E.OverCommitAllowed(over_commit_allowed))
if vm_discovery_enabled is not None:
params.append(E.VmDiscoveryEnabled(vm_discovery_enabled))
if is_elastic:
params.append(E.IsElastic(is_elastic))
if include_memory_overhead:
params.append(E.IncludeMemoryOverhead(include_memory_overhead))
return self.client.post_linked_resource(
resource_admin, RelationType.ADD, EntityType.VDCS_PARAMS.value,
params)
Expand Down

0 comments on commit 88b7fb7

Please sign in to comment.