setvcpus
Changes the number of virtual CPUs of a virtual server.
Syntax
- <count>
-
- If the --maximum option is not specified:
- Specifies the actual number of virtual CPUs which are made available for the virtual server.
This value is limited by the maximum number of virtual CPUs. This number is configured with the vcpu element and can be modified during operation. If no number is specified, the maximum number of virtual CPUs is 1.
If <count> is less than the actual number of available virtual CPUs, specify the --config option to remove the appropriate number of virtual CPUs with the next virtual server reboot. Until then, the virtual server user might set the corresponding number of virtual CPUs offline.
- If the --maximum option is specified:
- Specifies the maximum number of virtual CPUs which can be made available after the next virtual server reboot.
Do not specify more virtual CPUs than available host CPUs.
- <VS>
- Is the name, ID, or UUID of the virtual server.
Selected options
- --config
- Changes the number the next time the virtual server is started.
- --current, --live
- Changes the number of available virtual CPUs immediately.
- --domain
- Specifies the virtual server.
- --maximum
- Changes the maximum number of virtual CPUs that can be made available after the next virtual server reboot.
Usage
Modifying the number of virtual CPUsExample
This example persistently adds a virtual CPU to the running virtual server
vserv1:
# virsh vcpucount vserv1 maximum config 5 maximum live 5 current config 3 current live 3 # virsh setvcpus vserv1 4 --live --config # virsh vcpucount vserv1 maximum config 5 maximum live 5 current config 4 current live 4