Saturday 9 July 2016

xe CLI Commands

xe CLI Commands


Display the Static Memory Properties of a VM


1. Find the uuid of the required VM: xe vm-list
2. Note the uuid, and then run the command param-name=memory-static
xe vm-param-get uuid=<uuid> param-name=memory-static-{min,max}
For example, the following displays the static maximum memory properties for the VM with the uuid beginning
ec77:
xe vm-param-get uuid= \
ec77a893-bff2-aa5c-7ef2-9c3acf0f83c0 \
param-name=memory-static-max;
268435456

This shows that the static maximum memory for this VM is 268435456 bytes (256MB).

Display the Dynamic Memory Properties of a VM


To display the dynamic memory properties, follow the procedure as above but use the command paramname= memory-dynamic:

1. Find the uuid of the required VM:
xe vm-list
2. Note the uuid, and then run the command param-name=memory-dynamic:
xe vm-param-get uuid=<uuid> param-name=memory-dynamic-{min,max}

For example, the following displays the dynamic maximum memory properties for the VM with uuid beginning ec77
xe vm-param-get uuid= \
ec77a893-bff2-aa5c-7ef2-9c3acf0f83c0 \
param-name=memory-dynamic-max;
134217728

This shows that the dynamic maximum memory for this VM is 134217728 bytes (128MB).

Updating Memory Properties


Warning:

It is essential that you use the correct ordering when setting the static/dynamic minimum/ maximum parameters. In addition you must not invalidate the following constraint:

0 ≤ memory-static-min ≤ memory-dynamic-min ≤ memory-dynamic-max
≤ memory-static-max

Update the static memory range of a virtual machine:
xe vm-memory-static-range-set uuid=<uuid> min=<value>max=<value>

Update the dynamic memory range of a virtual machine:
xe vm-memory-dynamic-range-set \
uuid=<uuid> min=<value> \
max=<value>

Specifying a target is particularly useful in virtual server environments, and in any situation where you know exactly how much memory you want a guest to use. XenServer will adjust the guest's memory allocation to meet the target you specify. For example:

xe vm-target-set target=<value> vm=<vm-name>

Update all memory limits (static and dynamic) of a virtual machine:
xe vm-memory-limits-set \
uuid=<uuid> \
static-min=<value> \
dynamic-min=<value> \
dynamic-max=<value> static-max=<value>

Note:

• To allocate a specific amount memory to a VM that won't change, set the Dynamic Maximum and Dynamic Minimum to the same value.
• You cannot increase the dynamic memory of a VM beyond the static maximum.
• To alter the static maximum of a VM – you will need to suspend or shut down the VM.

Update Individual Memory Properties


Warning:

Citrix advises not to change the static minimum level as this is set at the supported level per operating system – refer to the memory constraints table for more details.

Update the dynamic memory properties of a VM.

1. Find the uuid of the required VM:
xe vm-list
2. Note the uuid, and then use the command memory-dynamic-{min,max}=<value>
xe vm-param-set uuid=<uuid>memory-dynamic-{min,max}=<value>

The following example changes the dynamic maximum to 128MB:
xe vm-param-set uuid=ec77a893-bff2-aa5c-7ef2-9c3acf0f83c0 memory-dynamic-max=128MiB

No comments:

Post a Comment