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

Support for flex allocation model in org vdc creation #730

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
14 changes: 12 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,10 @@ 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 +1595,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