0

I am trying to reduce the number of VCPU on Dom0, but not understanding why its not reducing the number.

Log:

[2016-02-11 13:43:25 2550] INFO (XendDomainInfo:1977) Set VCPU count on domain Domain-0 to 5

Commands:

root@user:/home/user# xm list
Name                                        ID   Mem VCPUs      State   Time(s)
Domain-0                                     0  2024    10     r-----    994.1
root@user:/home/user# sudo xm vcpu-set Domain-0 5
root@user:/home/user# xm list
Name                                        ID   Mem VCPUs      State   Time(s)
Domain-0                                     0  2024    10     r-----    994.4
  • Please, check if you are using Full-virtualization (HVM). The command vcpu-set dont work with HVM (http://manpages.ubuntu.com/manpages/precise/man1/xm.1.html) – Jose Raul Barreras Feb 22 '16 at 16:05
  • It does work with HVM. I am able to to reduce/increase Vcpu with xm vcpu-set but xm list is not showing the correct vcpu count. If I check lscpu it shows me the updated value. I am not sure why xm list is not showing the correct values for vcpu. – user3580316 Feb 22 '16 at 18:40

1 Answers1

2

This is a similar case where xm list failed to list configuration changes:

https://serverfault.com/a/484904/337307

The issue occurs because a configuration file that is generated when the VM is first created cannot be modified, it must be regenerated to have xm list report the current configuration.

The steps used to regenerate the file were as follows:

  1. Shut down the VM (DomU)
  2. Export the VM configuration to a text file with the command

    xm list -l DomU_name > vm.conf

  3. Use a text editor to edit file VM configuration, eg vi vm.conf

  4. Delete the VM from Xend and re-create it using the modified config file, using the following commands:

    xm del DomU_name xm new -F vm.conf

  5. Start the modified VM

    xm start DomU_name

Or you can use xm delete and xm new to generate a new entry instead of importing the modified config file as the accepted answer suggests. https://serverfault.com/a/484832/337307

Hopefully this helps!

sippybear
  • 2,997
  • 1
  • 12
  • 12
  • When I run the command I get this error: `xm delete database Error: Domain is not halted. Usage: xm delete Remove a domain from Xend domain management.` – user3580316 Feb 28 '16 at 13:25