Ask Your Question

Libvirt.xml template

asked 2013-11-18 09:52:36 -0500

rz2p gravatar image

updated 2013-11-19 03:10:52 -0500

I am running "nova-manage version:" 2013.2

Trying to figure out where I would edit the default libvirt.xml template. Looks like it was removed. I want this line to be in every single instance going forward:

<graphics autoport="yes" keymap="en-us" listen="" passwd="PASSWORD123" type="vnc"></graphics>

I am basically trying to put a default VNC password on our instances.

I have other ideas in mind also. If someone could tell me what I need to do to get that file up and running that would be great.


edit retag flag offensive close merge delete


smaffulli gravatar imagesmaffulli ( 2013-11-20 14:12:16 -0500 )edit

I am the person who wrote the Answer to that question :) I am trying to avoid the virsh destroy and the virsh start. I do not want to affect any running VMs. virt-manager can do it..Virsh is a CLI version of virt-manager so I don't get what the difference is. Thanks though.

rz2p gravatar imagerz2p ( 2013-11-20 14:14:31 -0500 )edit

Did you ever find the answer to this question?

neerbeer gravatar imageneerbeer ( 2015-02-24 13:18:17 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2015-07-03 04:11:00 -0500

fifieldt gravatar image

It looks like libvirt.xml is generated from the code in nova/virt/libvirt/

_get_guest_xml calls _get_guest_config , which calls a ton of things to get all the necessary item to generate the file for each instance.

So, you're looking at modifying that python script, probably inside the _get_guest_config method to add something that adds in the password. Since you're modifying the graphics area, you're probably looking at changing:

           graphics = vconfig.LibvirtConfigGuestGraphics()
            graphics.type = "vnc"
            graphics.keymap = CONF.vnc.keymap
            graphics.listen = CONF.vnc.vncserver_listen
            add_video_driver = True

I'm going to guess there'll be something like graphics.passwd that you can set.

Anyway, you probably shouldn't have to add the code to do this, so it might be worth filing a bug.

edit flag offensive delete link more


Same here, I want to add in all instances the parameters <emulator> so that libvirt uses another path than the default /usr/libexec/qemu-kvm to start the VMs. But I don't find where to add this as a default parameter.

GLaupre gravatar imageGLaupre ( 2015-07-08 16:38:28 -0500 )edit

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



Asked: 2013-11-18 09:52:36 -0500

Seen: 1,862 times

Last updated: Jul 03 '15