4.1.16.1. Modifying Virtual Machine Configuration

The prlctl set command is used to modify the virtual machine configuration parameters.

Syntax. 

prlctl set <VM_name> [--cpus <number>] [--memsize <number>]
           [--videosize <number>] [--memguarantee <percentage>]
           [--mem-hotplug <on|off>] [--distribution _<name>] [--description <desc>]
           [--autostart <on|off|auto>] [--autostart-delay <number>]
           [--autostop <stop|suspend>] [--applyconfig <conf>] [--name <new_name>]
           [--start-as-user <administrator|owner|<user>:_<passwd>_]
           [--vnc-mode <auto|manual|off> {--vnc-passwd <passwd> | --vnc-nopasswd}]
           [--vnc-port <port>] [--vnc-address <address>] [--cpu-hotplug <on|off>]
           [--cpuunits <units>] [--cpulimit {<percent>|<megahertz>}]
           [--ioprio <priority>] [--iolimit <limit>] [--iopslimit <limit>]
           [--cpumask {<N>[,N,N1-N2] | all}] [--offline-management <on|off>]
           [--offline-service <service_name>] [--userpasswd <user>:<passwd>
           [--crypted]] [--rate <rate>] [--ratebound <on|off>_]
           [--apply-iponly <yes|no>] [--efi-boot <on|off>]
           [--tools-autoupdate <on|off>]

Table 4.16. Options

NameDescription

<VM_name>

Target virtual machine name.

--cpus <number>

Number of virtual CPUs in the virtual machine. If the server has several CPU cores, this option also defines the number of CPUs shown to users from inside a virtual machine.

--memsize <number>

The amount of memory (RAM) available to the virtual machine, in megabytes. You can use the following suffixes to specify measurement units:

  • G for gigabytes
  • M for megabytes
  • K for kilobytes
  • B for bytes

--videosize <number>

The amount of video memory available to the virtual machine graphics card. You can use the following suffixes to specify measurement units:

  • G for gigabytes
  • M for megabytes
  • K for kilobytes
  • B for bytes

--memguarantee <size>

Sets a percentage of virtual machine’s RAM that said VM is guaranteed to have. By default, set to 40%.

--mem-hotplug <on|off>

Enables or disables memory (RAM) hotplug support in the virtual machine. This feature is disabled in the virtual machine by default. The guest operating system must support memory hotplug for this functionality to work.

--distribution <name>

Optimize the virtual machine for use with  the  operating  system <name>. You can get the list of available distributions using the prlctl set <VM_name> -d list command.

--description <desc>

Sets virtual machine description. Descriptions with white spaces must be enclosed in quotation marks.

--autostart <on|off|auto>

Defines the virtual machine start-up options:

  • on - the virtual machine is started automatically wen the hardware node starts or the OpenVZ component responsible for managing virtual machines is disabled.
  • off - the autostart is off. This is the default virtual machine start-up mode.
  • auto - resume the virtual machine state prior to shutting down the hardware node or disabling the OpenVZ component responsible for managing virtual machines.

If you set this option to on or auto, you must additionally specify the --start-as-user option.

--autostart-delay <number>

Sets the time delay used during the virtual machine automatic startup.

--autostop <|suspend>

Sets the automatic shutdown mode for the specified virtual machine:

  • stop - the virtual machine is stopped when you shut down the hardware node or disable the OpenVZ component responsible for managing virtual machines.
  • suspend - the virtual machine is suspended when the hardware node is shut down or the OpenVZ component responsible for managing virtual machines is disabled.

--applyconfig <conf>

Applies the resource parameter values from the specified VM sample file in /etc/parallels/samples to the virtual machine. The following parameters are applied:

  • all memory-related parameters (both RAM and video)
  • all CPU-related parameters
  • IO and IOPS limits
  • disk size

--name <new_name>

Changes the virtual machine name. You can only change the names of stopped virtual machines.

--start-as-user <administrator|owner|<user>:<passwd>

Specifies the account to use to autostart the virtual machine:

  • administrator - start the virtual machine as the administrator of the host operating system.
  • owner - start the virtual machine as the virtual machine owner.
  • <user>:<passwd> - start the virtual machine as the specified user.

--vnc-mode <auto|manual|off>

Enables or disables access to the virtual machine via the VNC protocol.

--vnc-port <port>

Sets the VNC port number.

--vnc-passwd <passwd> | --vnc-nopasswd

Sets the VNC password or specifies that no password is needed for VNC connections. Either of these options is mandatory for any VNC connection.

--vnc-address <address>

Sets the IP address to use for logging in to the virtual machine via VNC. It must be one of the IP addresses assigned to the hardware node. By default, you can use any of the IP addresses of the hardware node to log in to the virtual machine.

--cpu-hotplug <on|off>

Enables or disables CPU hotplug support in the virtual machine. This feature is disabled by default. The guest operating system must support CPU hotplug for this functionality to work.

--cpuunits <units>

Sets the CPU weight for the virtual machine. This is a positive integer number that defines how much CPU time the virtual machine can get as compared to the other virtual machines and containers running on the server. The larger the number, the more CPU time the virtual machine can receive. Possible values range from 8 to 500000. If this parameter is not set, the default value of 1000 is used.

--cpulimit {<percent>|<megahertz>}

CPU limit, in percent or megahertz (MHz) the virtual machine is not allowed to exceed.  By default, the limit is set in percent. To set the limit in MHz, specify "m" after the value.

Note

Note: If the server has 2 processors, the total CPU time equals 200%.

--ioprio <priority>

Disk I/O priority level from 0 to 7. The default is 4.

--iolimit <limit>

Disk I/O bandwidth limit. The default is 0 (no limit). By default the limit is set in megabytes per second. You can use the following letters following the number to specify units of measure:

  • G - gigabytes per second (e.g., 1G).
  • K - kilobytes per second (e.g., 10K).
  • B - bytes per second (e.g., 100B).

The default I/O bandwidth limit for all newly created virtual machines is set to 0, which means that no limits are applied to them.

--iopslimit <limit>

Maximum number of disk input and output operations per second a virtual machine is allowed to perform. By default, any newly created container does not have the IOPS limit set and can perform so many disk I/O operations per second as necessary.

--cpumask {<N>[,N,N1-N2] | all}

An affinity mask indicating what CPU(s) the virtual machine processes should be run on. You can specify a list of CPUs identified by their index numbers separated by commas (0, 1, 2, 3, etc.) or a range (4-6). To make all CPUs available for the virtual machine processes specify --cpumask all.

--offline-management <on|off>

Turns the offline management on or off.

--offline-service <service_name>

The name of the service to use for offline management.

--userpasswd <user>:<passwd>

Sets the password for the specified user in the virtual machine. If the user account does not exist, it will be created. OpenVZ tools must be installed in the virtual machine for the command to work.

--crypted

Used with --userpasswd. Indicates that the specified password is already a hash.

--rate <rate>

Sets the guaranteed outgoing traffic rate in Kbps for the virtual machine.

--ratebound <on|off>

Turns the network traffic rate limitation set by the --rate parameter (above) on or off. The default value is off.

--apply-iponly <yes|no>

If set to yes, the hostname, nameserver, and search domain settings from the virtual machine configuration file are ignored.

--efi-boot <on|off>

If set to on, the virtual machine will boot using the EFI firmware. If set to off (default), the virtual machine will boot using the BIOS firmware.

--tools-autoupdate <on|off>

Enables or disables automatic update of OpenVZ tools inside Windows virtual machines. If set to on, OpenVZ tools are updated automatically on user log in. A reboot is required to complete the update. If set to off, OpenVZ tools are not updated automatically, so that you can do it manually at a convenient time.