Ask Your Question
0

How to set cpuset attribute in vcpu element in instance xml?

asked 2013-06-26 08:40:30 -0500

peegupta gravatar image

Hi, in relation to the changes shown here : https://blueprints.launchpad.net/nova/+spec/instance-vcpu-pin (https://blueprints.launchpad.net/nova...) , I want to set cpuset attribute. But I can't enable this. I tried to add vcpu_pin_set to nova.conf , but it's not working. I am using devstack on Ubuntu 12.04. What am I doing wrong?

edit retag flag offensive close merge delete

11 answers

Sort by » oldest newest most voted
0

answered 2013-07-01 09:28:15 -0500

peegupta gravatar image

Okay, thanks again for your time.

edit flag offensive delete link more
0

answered 2013-07-01 08:16:03 -0500

peegupta gravatar image

Thanks wangpan, that solved my question.

edit flag offensive delete link more
0

answered 2013-06-27 01:14:58 -0500

1.what hypervisor are you using? 2.how many pcpus you have? 3.what the vcpu_pin_set config you set? 4.can you give me the libvirt.xml of your instance?

2013-06-27

Wangpan

发件人:Peeyush Gupta question231384@answers.launchpad.net 发送时间:2013-06-26 16:41 主题:[Question #231384]: How to set cpuset attribute in vcpu element in instance xml? 收件人:"hzwangpan"hzwangpan@corp.netease.com 抄送:

New question #231384 on OpenStack Compute (nova): https://answers.launchpad.net/nova/+question/231384 (https://answers.launchpad.net/nova/+q...)

Hi, in relation to the changes shown here : https://blueprints.launchpad.net/nova/+spec/instance-vcpu-pin (https://blueprints.launchpad.net/nova...) , I want to set cpuset attribute. But I can't enable this. I tried to add vcpu_pin_set to nova.conf , but it's not working. I am using devstack on Ubuntu 12.04. What am I doing wrong?


You received this question notification because you are a direct subscriber of the question.

edit flag offensive delete link more
0

answered 2013-06-27 05:21:31 -0500

peegupta gravatar image

Hi wangpan, thanks for the reply. I am running Ubuntu 12.04 as a VM on Fedora 18 host. Here are the details:

  1. I am using kvm.
  2. I have 3 pcpus.
  3. I set vcpu_pin_set = 2 in nova.conf
  4. Here is the xml:

<domain type="qemu"> <name>instance-00000009</name> <uuid>08c556d1-1e23-484e-94b2-e973eeb1b936</uuid> <memory>524288</memory> <currentmemory>524288</currentmemory> <vcpu>1</vcpu> <sysinfo type="smbios"> <system> <entry name="manufacturer">OpenStack Foundation</entry> <entry name="product">OpenStack Nova</entry> <entry name="version">2013.2</entry> <entry name="serial">bd348807-a480-1b3f-eb66-65b2d88cba58</entry> <entry name="uuid">08c556d1-1e23-484e-94b2-e973eeb1b936</entry> </system> </sysinfo> <os> <type arch="x86_64" machine="pc-1.0">hvm</type> <boot dev="hd"/> <smbios mode="sysinfo"/> </os> <features> <acpi/> <apic/> </features> <clock offset="utc"/> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> <disk type="file" device="disk"> <driver name="qemu" type="qcow2" cache="none"/> <source file="/opt/stack/data/nova/instances/08c556d1-1e23-484e-94b2-e973eeb1b936/disk"/> <target dev="vda" bus="virtio"/>

</disk> <interface type="bridge"> <mac address="fa:16:3e:79:07:c0"/> <source bridge="br100"/> <model type="virtio"/> <driver name="qemu"/> <filterref filter="nova-instance-instance-00000009-fa163e7907c0"/>
</interface> <serial type="file"> <source path="/opt/stack/data/nova/instances/08c556d1-1e23-484e-94b2-e973eeb1b936/console.log"/> <target port="0"/> </serial> <serial type="pty"> <target port="1"/> </serial> <console type="file"> <source path="/opt/stack/data/nova/instances/08c556d1-1e23-484e-94b2-e973eeb1b936/console.log"/> <target type="serial" port="0"/> </console> <input type="tablet" bus="usb"/> <input type="mouse" bus="ps2"/> <graphics type="vnc" port="-1" autoport="yes" listen="127.0.0.1" keymap="en-us"> <listen type="address" address="127.0.0.1"/> </graphics> <video> <model type="cirrus" vram="9216" heads="1"/>
</video> <memballoon model="virtio">
</memballoon> </devices> </domain>

                                                                                                                                        1,1           Top
edit flag offensive delete link more
0

answered 2013-07-01 08:15:48 -0500

peegupta gravatar image

Hi wangpan, sorry for replying late, I was busy with some other stuff. I tried it out and guess what, it's working! Thank you very much! One more thing, is there any way to pin cpus dynamically? Meaning that when I give "nova boot" command can I decide which cpus I am going to pin this particular VM and the result reflects in the VM's xml? Does this mechanism works for each instance or just for making groups for libvirt to use?

edit flag offensive delete link more
0

answered 2013-06-27 05:57:20 -0500

where you added the vcpu_pin_set = 1 to nova.conf? the [DEFAULT] section or just at the end of nova.conf? if you didn't add it to the correct [DEFAULT] section, it will be invalid. you can try ot add it like this: ubuntu@wp-devstack:/opt/stack/nova$ head /etc/nova/nova.conf

[DEFAULT] vcpu_pin_set = 1 log_dir=/var/log/nova compute_driver = libvirt.LibvirtDriver firewall_driver = nova.virt.libvirt.firewall.IptablesFirewallDriver

2013-06-27

Wangpan

发件人:Peeyush Gupta question231384@answers.launchpad.net 发送时间:2013-06-27 13:26 主题:Re: [Question #231384]: How to set cpuset attribute in vcpu element in instance xml? 收件人:"hzwangpan"hzwangpan@corp.netease.com 抄送:

Question #231384 on OpenStack Compute (nova) changed: https://answers.launchpad.net/nova/+question/231384 (https://answers.launchpad.net/nova/+q...)

Status: Answered => Open

Peeyush Gupta is still having a problem: Hi wangpan, thanks for the reply. I am running Ubuntu 12.04 as a VM on Fedora 18 host. Here are the details:

  1. I am using kvm.
  2. I have 3 pcpus.
  3. I set vcpu_pin_set = 2 in nova.conf
  4. Here is the xml:

<domain type="qemu"> <name>instance-00000009</name> <uuid>08c556d1-1e23-484e-94b2-e973eeb1b936</uuid> <memory>524288</memory> <currentmemory>524288</currentmemory> <vcpu>1</vcpu> <sysinfo type="smbios"> <system> <entry name="manufacturer">OpenStack Foundation</entry> <entry name="product">OpenStack Nova</entry> <entry name="version">2013.2</entry> <entry name="serial">bd348807-a480-1b3f-eb66-65b2d88cba58</entry> <entry name="uuid">08c556d1-1e23-484e-94b2-e973eeb1b936</entry> </system> </sysinfo> <os> <type arch="x86_64" machine="pc-1.0">hvm</type> <boot dev="hd"/> <smbios mode="sysinfo"/> </os> <features> <acpi/> <apic/> </features> <clock offset="utc"/> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> <disk type="file" device="disk"> <driver name="qemu" type="qcow2" cache="none"/> <source file="/opt/stack/data/nova/instances/08c556d1-1e23-484e-94b2-e973eeb1b936/disk"/> <target dev="vda" bus="virtio"/>

</disk> <interface type="bridge"> <mac address="fa:16:3e:79:07:c0"/> <source bridge="br100"/> <model type="virtio"/> <driver name="qemu"/> <filterref filter="nova-instance-instance-00000009-fa163e7907c0"/>
</interface> <serial type="file"> <source path="/opt/stack/data/nova/instances/08c556d1-1e23-484e-94b2-e973eeb1b936/console.log"/> <target port="0"/> </serial> <serial type="pty"> <target port="1"/> </serial> <console type="file"> <source path="/opt/stack/data/nova/instances/08c556d1-1e23-484e-94b2-e973eeb1b936/console.log"/> <target type="serial" port="0"/> </console> <input type="tablet" bus="usb"/> <input type="mouse" bus="ps2"/> <graphics type="vnc" port="-1" autoport="yes" listen="127.0.0.1" keymap="en-us"> <listen type="address" address="127.0.0.1"/> </graphics> <video> <model type="cirrus" vram="9216" heads="1"/>
</video> <memballoon model="virtio">
</memballoon> </devices> </domain>

1,1 Top


You received this question notification because you are a direct subscriber of the question.

edit flag offensive delete link more
0

answered 2013-06-27 06:57:48 -0500

peegupta gravatar image

I have added it to the [DEFAULT] section only. When I did head /etc/nova/nova.conf, I got this:

root@peeyush-virtual-machine:/opt/stack/nova# head /etc/nova/nova.conf

[DEFAULT] vcpu_pin_set = 2 log_dir = /var/log/nova firewall_driver = nova.virt.libvirt.firewall.IptablesFirewallDriver compute_driver = libvirt.LibvirtDriver flat_interface = eth0 flat_network_bridge = br100 vlan_interface = eth0 public_interface = br100

I launched a new instance after that and it's still not working. Still there is no cpuset attribute in the vcpu element.

edit flag offensive delete link more
0

answered 2013-06-27 07:13:10 -0500

have you restart your nova processes after added vcpu_pin_set to nova.conf? such as nova-compute? and you may grep 'vcpu_pin_set' /var/log/nova/nova-compute.log and check the result, mine is: 2013-06-27 05:51:41.335 DEBUG nova.openstack.common.service [-] vcpu_pin_set = 1 from (pid=23026) log_opt_values /usr/local/lib/python2.7/dist-packages/oslo/config/cfg.py:1481

2013-06-27

Wangpan

发件人:Peeyush Gupta question231384@answers.launchpad.net 发送时间:2013-06-27 15:01 主题:Re: [Question #231384]: How to set cpuset attribute in vcpu element in instance xml? 收件人:"hzwangpan"hzwangpan@corp.netease.com 抄送:

Question #231384 on OpenStack Compute (nova) changed: https://answers.launchpad.net/nova/+question/231384 (https://answers.launchpad.net/nova/+q...)

Status: Answered => Open

Peeyush Gupta is still having a problem: I have added it to the [DEFAULT] section only. When I did head /etc/nova/nova.conf, I got this:

root@peeyush-virtual-machine:/opt/stack/nova# head /etc/nova/nova.conf

[DEFAULT] vcpu_pin_set = 2 log_dir = /var/log/nova firewall_driver = nova.virt.libvirt.firewall.IptablesFirewallDriver compute_driver = libvirt.LibvirtDriver flat_interface = eth0 flat_network_bridge = br100 vlan_interface = eth0 public_interface = br100

I launched a new instance after that and it's still not working. Still there is no cpuset attribute in the vcpu element.


You received this question notification because you are a direct subscriber of the question.

edit flag offensive delete link more
0

answered 2013-06-27 07:35:36 -0500

peegupta gravatar image

Okay, looks like devstack doesn't have services, it has screens and I am not sure how to restart them. I am gonna need some time to figure that out. Plus, for God knows what reason my devstack setup doesn't log anything!

edit flag offensive delete link more
0

answered 2013-06-27 08:21:14 -0500

you should mkdir for log_dir(/var/log/nova) and chown to the user nova process used. and in my devstack(host is ubuntu 12.04), I just killed the nova-compute process by kill pid-of-nova-compute, and then start it manually by: nohup nova-compute 2>/dev/null & by the way, if the log of nova-compute is nothing after you mkdir and chown, you can start nova-compute by: nohup nova-compute 2>/tmp/nova-compute.log & and you can see the log at /tmp/nova-compute.log.

2013-06-27

Wangpan

发件人:Peeyush Gupta question231384@answers.launchpad.net 发送时间:2013-06-27 15:36 主题:Re: [Question #231384]: How to set cpuset attribute in vcpu element in instance xml? 收件人:"hzwangpan"hzwangpan@corp.netease.com 抄送:

Question #231384 on OpenStack Compute (nova) changed: https://answers.launchpad.net/nova/+question/231384 (https://answers.launchpad.net/nova/+q...)

Status: Answered => Open

Peeyush Gupta is still having a problem: Okay, looks like devstack doesn't have services, it has screens and I am not sure how to restart them. I am gonna need some time to figure that out. Plus, for God knows what reason my devstack setup doesn't log anything!


You received this question notification because you are a direct subscriber of the question.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2013-06-26 08:40:30 -0500

Seen: 716 times

Last updated: Jul 01 '13