Previous Topic: dpmvc-setresources Command--Set VM Resources (Funclet)Next Topic: dpmvc-snapshot Command--Manage Snapshots (Funclet)


dpmvc-setshares Command--Set VM Shares (Funclet)

The dpmvc-setshares command lets you set how many shares of CPU or memory are allocated to a VM.

This command has the following format:

dpmvc-setshares
{-datacenter_name datacentername | -vc vcenterservername}
-vm_name vmname 
-setshare {cpu_add_prop_value | cpu_subtract_prop_value | 
cpu_overwrite_prop_value |mem_add_prop_value |mem_subtract_prop_value |
-mem_overwrite_prop_value}
-value value
-setshare {cpu_add_prop_value | cpu_subtract_prop_value | cpu_overwrite_prop_value | mem_add_prop_value | mem_subtract_prop_value | mem_overwrite_prop_value}

Defines how many shares of CPU or memory to add, subtract, or change. Shares are used to determine which VMs are given more of the available physical resources proportionally to other running VMs. If you allocate more shares to a VM, more physical resources are given to that VM. If you allocate fewer shares to a VM, fewer physical resources are given to that VM.

cpu_add_prop_value

Defines the number of shares of CPU to add to the VM.

-cpu_subtract_prop_value value

Defines the number of shares of CPU to subtract from the VM.

-cpu_overwrite_prop_value value

Defines the number of shares of CPU to use for the VM.

-mem_add_prop_value value

Defines the number of shares of memory to add to the VM.

-mem_subtract_prop_value value

Defines the number of shares of memory to subtract from the VM.

-mem_overwrite_prop_value value

Defines the number of shares of CPU to use for the VM.

-datacenter_name datacentername

Specifies the data center where the VM is located.

-vc vcenterservername

Specifies the vCenter Server where the VM is located.

-vm_name vmname

Specifies the VM.

-value value

Specifies the value for the resource parameter.

Example: Increase CPU Shares for a VM in a Single vCenter Server Environment

This example increases the CPU shares for the virtual machine "MyVM01" by 1000 in the data center "VAS/MyCity."

dpmvc-setshares -vm_name MyVM01 -datacenter_name VAS/MyCity -setshare cpu_add_prop_value -value 1000