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

Add --mem-allocated to vdc create #539

Open
wants to merge 4 commits 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
24 changes: 22 additions & 2 deletions vcd_cli/vdc.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,18 @@ def vdc(ctx):
vcd vdc create dev-vdc -p prov-vdc -n net-pool -s '*' \\
-a ReservationPool -d 'vDC for development'
Create new virtual datacenter.

\b
vcd vdc create dev-vdc \\
--provider-vdc prov-vdc \\
--network-pool net-pool \\
--network-quota 10240 \\
--storage-profile '*' \\
--storage-profile-limit 10240 \\
--allocation-model AllocationPool \\
--cpu-allocated 3000 \\
--memory-allocated 2048 \\
--description 'vDC for development'
Create new virtual datacenter.
\b
vcd vdc disable dev-vdc
Disable virtual datacenter.
Expand Down Expand Up @@ -242,15 +253,23 @@ def use(ctx, name):
metavar='<cpu-limit>',
type=click.INT,
help='Capacity limit relative to the value specified for Allocation.')
@click.option(
'--mem-allocated',
required=False,
default=0,
metavar='<mem-allocated>',
type=click.INT,
help='Capacity (in MB) that is commited to be available.')
@click.option(
'--network-quota',
required=False,
default=0,
metavar='<network-quota>',
type=click.INT,
help='Maximum number of network objects that can be deployed in this vdc.')

def create(ctx, name, pvdc_name, network_pool_name, allocation_model, sp_name,
sp_limit, description, cpu_allocated, cpu_limit, network_quota):
sp_limit, description, cpu_allocated, cpu_limit, network_quota, mem_allocated):
try:
restore_session(ctx)
client = ctx.obj['client']
Expand All @@ -273,6 +292,7 @@ def create(ctx, name, pvdc_name, network_pool_name, allocation_model, sp_name,
cpu_limit=cpu_limit,
storage_profiles=storage_profiles,
network_quota=network_quota,
mem_allocated=mem_allocated,
uses_fast_provisioning=True,
is_thin_provision=True)
stdout(vdc_resource.Tasks.Task[0], ctx)
Expand Down