To configure the capabilities of a virtual machine, you use properties of the VirtualMachineConfigSpec data object to specify the machine characteristics available to the guest operating system. The guest uses these capabilities in the same way as resources on a physical machine.
Configuring Virtual CPUs
Set the number of virtual CPU cores for the virtual machine with the VirtualMachineConfigSpec.numCPUs
property. Legal values for this property change depending on the guestosid value you specify. If you use VirtualMachineConfigSpec
to update the virtual machine properties, you can omit this property to leave it unchanged.
The guest operating system acts as if it had numCPUs
cores available at all times, but the host's physical resources are shared by all its virtual machines. The host allocates physical cores in time slices aa backing for virtual cores. For information about how to specify guidance for resource allocation, see Configuring Resource Allocation Constraints for Virtual Machines.
Configuring Multi-Core CPUs
Set the number of cores per CPU chip with the VirtualMachineConfigSpec.numCoresPerSocket
property. The value must be an integral divisor of VirtualMachineConfigSpec.numCPUs
. The default value is 1
if the property is omitted for virtual machine creation. If you use VirtualMachineConfigSpec
to update the virtual machine properties, you can omit this property to leave it unchanged.
Configuring Memory
Set the RAM size for a virtual machine with the VirtualMachineConfigSpec.memoryMB
property. If you use VirtualMachineConfigSpec
to update the virtual machine properties, you can omit this property to leave it unchanged.
The guest operating system acts as if it had memoryMB
available at all times, but the host's physical resources are shared by all its virtual machines. The amount of physical memory available as backing for virtual machines can vary over time, and it can affect virtual machine performance. For information about how to specify guidance for resource allocation, see Configuring Resource Allocation Constraints for Virtual Machines.