Allocating Resources

Resources are allocated to a machine from the cluster based on the VM template instructions. If you create a VM from the Instance menu, it will instantiate based on predefined template parameters; however, if you create a VM via the Template menu, after clicking ‘Instantiate’, you are given the opportunity to adjust these resource allocations prior to fully standing up the machine. If it is found to require more resources, these values can be updated, but an outage will be necessary.

Memory

Templates

Templates can be used to specify a memory value or range of values for VMs created using them.

When initially instantiating a machine, it is necessary to allocate enough RAM to sufficiently process the tasks the box will handle; therefore, if you have a base template with the desired OS and any appliances etc. pre-loaded, you can navigate to the Template menu and click VM and select the base template.

VM template list

Now click Update

From here you assign the desired memory allocation in units of MB.

Capacity adjustment

If you wish to enable memory resizing for VMs based on this template, you can check “Enable hot resize” next to memory. Once enabled, the Memory field shows the minimum memory for the VM and the upper limit for hot resizing can be set in Max Memory. If no hot resizing limit is set then the memory can be increased up to a maximum allowed by the template.

Hot-resizing is not necessary to resize a VM, if you prefer or your OS does not support hot-resizing, the VM can be powered off and resized offline. On the next boot the new resource allocation will be visible to the OS.

Memory modification allows for the administrator to limit memory values for VMs based on this template:

  • Any value - VMs can use any amount of memory
  • Fixed - VMs must use the value of memory set in the template.
  • List - VMs pick from a list of allowed memory values entered in the template
  • Range - VMs choose a value between the Min and Max set in the template

VMs

To adjust the memory, select the desired VM. If the VM is running and hot-plug is not enabled then you must power off the VM. From the resulting pane you can power off the machine; this option can be found at the top of the screen in the Power Button drop-down list. You will need to wait a short time for the system to power off the machine and may need to hit the Refresh button at the top of the pane after a few moments.

VM Power Off

Navigate to the capacity view and you should see that the resize button is now available. Click this button to pull up the Resize VM capacity pop-up and adjust as desired.

Resize VM Capacity

When adjustments are complete, press the ‘Resize’ button at the bottom of the pop-up window and then restart the machine by pressing the now-highlighted ‘Resume’ button.

Resize VM Capacity

CPU

CPU cycle allocation is scheduled by the hypervisor. When instantiating a VM, you are required to provide two fields with information; Physical CPU to be reserved for the VM, and Virtual CPU, which will be made available to the machine.

The steps required to alter the CPU allocation are the same as adjusting the memory. The device will need to be powered off and resumed after the adjustment is made as explained in that section.

Allocation of the Physical CPU is shown as a fraction of the servers actual CPU cores. An ideal ratio for desired Virtual CPU resources vs Physical CPU resources is 10:1; therefore, if the desired vCPUs are 4, the input for physical CPU allocation should be 0.4. This allows for over-subscription of the physical resources amongst multiple virtual devices and prevents one device from over-utilizing the cluster’s resources.

Physical CPU values are a system of weights, scaled to represent fractions of CPUs. The VMs will receive an amount of available CPU cycles based on their proportion of the shares of all active VMs on the host.

Idle or non-running VMs have an effective value of 0. The fractions shown in VM Squared are multiplied by 100 and applied to a Control Group CPU weight for each VM. For more information refer to the Control Groups V2 documentation.

Capacity adjustment

If you wish to enable Virtual CPU resizing for VMs based on this template you can check “Enable hot resize” next to Virtual CPU. Once enabled, the Virtual CPU field shows the minimum Virtual CPU for the VM and the upper limit for hot resizing can be set in Max Virtual CPU, If no hot resizing limit is set then the Virtual CPU can be increased up to maximum allowed by the template.

Hot-resizing is not necessary to resize a VM, if you prefer or your OS does not support hot-resizing, the VM can be powered off and resized offline. On the next boot the new resource allocation will be visible to the OS.

CPU modification allows for the administrator to limit memory values for VMs based on this template:

  • Any value - VMs can use any amount of Virtual or Physical CPU
  • Fixed - VMs must use the value of Virtual or Physical CPU set in the template.
  • List - VMs pick from a list of allowed Virtual or Physical CPU values entered in the template
  • Range - VMs choose a value between the Min and Max set in the template

Physical CPU does not require hot resizing, as these changes are not visible from the host OS, the hypervisor is merely allocating more cycles to the VM.

Disk

The disk(s) associated with the VM can be set by the template and additional disks can be added during instantiation. Set the preferred disk size of templates by editing the disk under Advanced options.

Edit Template Disk

Once the disk is opened for editing the initial size is set using the size on instantiate field in the disk’s advanced options.

Set disk size on instantiate

Disk capacity can also be expanded when the VM is in the “Running” state. Additional disks are created from images and a Generic Storage Datablock can be created or imported to add to the VM. Additional disks can be added to templates or attached to running VMs.

Volatile disks should never be used in a VM Squared instance.