[nova]Can I modify the xml of openstac instance by 'virsh edit'

韩光宇 hanguangyu2 at gmail.com
Wed Mar 23 07:35:50 UTC 2022


Hello,

I have a All-in-One OpenStack Victoria. And I want to bind vCPU of
openstack instance(guest) to pCPU of host.
# virsh edit instance-00000107
origin:
```
...
  <vcpu placement='static'>8</vcpu>
  <cputune>
    <shares>8192</shares>
  </cputune>
...
```

after modify:
```
  <vcpu placement='static' cpuset='104-111'>8</vcpu>
  <cputune>
    <shares>8192</shares>
   <vcpupin vcpu='0' cpuset='104'/>
   <vcpupin vcpu='1' cpuset='105'/>
   <vcpupin vcpu='2' cpuset='106'/>
   <vcpupin vcpu='3' cpuset='107'/>
   <vcpupin vcpu='4' cpuset='108'/>
   <vcpupin vcpu='5' cpuset='109'/>
   <vcpupin vcpu='6' cpuset='110'/>
   <vcpupin vcpu='7' cpuset='111'/>
   <emulatorpin cpuset='104-111'/>
  </cputune>
```
But If I stop and start instance by openstack command, xml
automatically recover.
And If I user `virsh shutdown instance-00000107 && virsh start
instance-00000107`, instance can't be start(I don't konw if the
openstack instance must be started using openstack command).

So:
1. Can I modify the xml of openstac instance by 'virsh edit'?
2. If I can't modify the xml, how can I bind vcpu of guest and pcpu of host

I would appreciate any kind of guidance or help.

HanGuangyu



More information about the openstack-discuss mailing list