document clearly that virsh create results in non-persistent domains

Bug #1381383 reported by Tenho Tuhkala
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libvirt (Ubuntu)
Triaged
Low
Unassigned

Bug Description

Ubuntu 14.04.1 LTS and 12.04 LTS

libvirt-bin 1.2.2-0ubuntu13.1.5 and 0.9.8-2ubuntu17.20

Creating vm from dumped xml with command: virsh create vm.xml
Runs fine until domain shut down.

Expected to happen:
Domain to remain permanent when shut down.

What happened:
Domain destroyed right after shut down.

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: libvirt-bin 1.2.2-0ubuntu13.1.5
ProcVersionSignature: Ubuntu 3.13.0-37.64-generic 3.13.11.7
Uname: Linux 3.13.0-37-generic x86_64
ApportVersion: 2.14.1-0ubuntu3.5
Architecture: amd64
CurrentDesktop: GNOME
Date: Wed Oct 15 10:28:46 2014
InstallationDate: Installed on 2014-05-08 (159 days ago)
InstallationMedia: Ubuntu 14.04 LTS "Trusty Tahr" - Release amd64 (20140417)
SourcePackage: libvirt
UpgradeStatus: No upgrade log present (probably fresh install)
modified.conffile..etc.libvirt.qemu.conf: [inaccessible: [Errno 13] Permission denied: '/etc/libvirt/qemu.conf']

Revision history for this message
Tenho Tuhkala (muppis) wrote :
Revision history for this message
Robie Basak (racb) wrote :

Thank you for your report.

This looks like a local configuration problem, rather than a bug in Ubuntu.

Your supplied XML contains "<on_poweroff>destroy</on_poweroff>". Your VM got destroyed on shutdown because this is what you requested.

You can find pointers to get help for this sort of problem here: http://www.ubuntu.com/support/community

Since we use this bug tracker to track bugs in Ubuntu, rather than configuration problems, I'm marking this bug as Invalid. This helps us to focus on fixing bugs in Ubuntu.

If you believe that this is really a bug, then we'd be grateful if you would then explain why you believe this is a bug in Ubuntu rather than a problem specific to your configuration, and then change the bug status back to New.

Changed in libvirt (Ubuntu):
status: New → Invalid
Revision history for this message
Tenho Tuhkala (muppis) wrote :

So if I dump vm from other host and try to import it to other I need to edit it to make stay persistent after poweroff? You can't know it if it's run for a while (with poweroffs and ons) in host 1 and then you move it to host 2 and it starts behaving like that.

As you might know, that's it a default setting of vm and not a adjustable setting in virt-manager nor virsh without editing directly xml in virsh or otherwise, so you can't rely admin knows it's needed to be edited to make vm not be destroyed after shutdown.
I still think it as a bug because of that.

Revision history for this message
Robie Basak (racb) wrote :

It sounds like you have a bigger issue here. Asking libvirt to create a VM that destroys on poweroff and then having it do that is not a bug. But perhaps there is a bug in how you ended up with that XML?

> As you might know, that's it a default setting of vm...

Really? I am not aware of this. Please could you provide step by step instructions to reproduce the creation of a VM where a subsequent exported XML ended up with "<on_poweroff>destroy</on_poweroff>" contrary to your expectations?

Revision history for this message
Tenho Tuhkala (muppis) wrote :

I made little examination about this issue and full console output, which says about all, is attached.
So create -command doesn't set Persistent flag to true and doesn't create related xml to under /etc/libvirt/qemu/ no matter is --autodestroy used or not where as define -command sets Persistent flag and creates xml under directory.

And is there really use for two commands to do the same thing but (not so) different way?

Revision history for this message
Tenho Tuhkala (muppis) wrote :
Revision history for this message
Robie Basak (racb) wrote :

virt-install is not part of libvirt. It is part of a separate tool, virtinst. It looks like this command is setting the "<on_poweroff>destroy</on_poweroff>" that you don't want.

I suggest that you read the virt-install documentation carefully, and if this still doesn't explain its behaviour and you think there's a bug in virt-install that incorrectly sets this flag, then to explain the details reassign this bug to "virtinst" and mark it as New.

Revision history for this message
Tenho Tuhkala (muppis) wrote :

This is not really about virt-install nor virt-manager (other listed virtual machines are created with it), it's about how virsh handles vm creation from xml. With define -command it stays at it should, with create -command it stays only when virsh is connected and/or vm is running, which behaviour isn't described anywhere and thus I considered as a bug in virsh.
As you can see from grep, all other vm got in on_poweroff -tag destroy as well and they stay persistent because they got a appropriate flag set. virsh create doesn't set it as it should according to the manual, or there's misinformation about this in manual.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote : Re: Vm destroyed when created with "virsh create" without --autodestroy

I'm marking this low priority per guidelines since there is a workaround (use virsh define). However it most certainly looks like a bug, especially since "--autodestroy" is listed as an option in the help usage.

summary: - Vm destroyed when created virsh create without --autodestroy
+ Vm destroyed when created with "virsh create" without --autodestroy
Changed in libvirt (Ubuntu):
importance: Undecided → Low
status: Invalid → Triaged
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

@Robie,

the <on_poweroff>destroy</on_poweroff> is ok - destroy simply means the domain is destroyed, not undefined.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Looking at the source code, the functions being called by cmdDefine versus cmdCreate make it quite clear that create makes non-persistent domains.

So this should be fixed in the documentation.

summary: - Vm destroyed when created with "virsh create" without --autodestroy
+ document clearly that virsh create results in non-persistent domains
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.