vms missing after upgrade from Lucid to Precise

Bug #931350 reported by Torsten Spindler
56
This bug affects 10 people
Affects Status Importance Assigned to Milestone
Release Notes for Ubuntu
Fix Released
Undecided
Unassigned
libvirt (Ubuntu)
Won't Fix
Medium
Unassigned
Precise
Won't Fix
Medium
Unassigned
virt-manager (Ubuntu)
Won't Fix
Undecided
Unassigned
Precise
Won't Fix
Undecided
Unassigned

Bug Description

None of the virtual machines setup under Lucid can be found after an upgrade to Precise via libvirt:

# virsh list --all
 Id Name State
----------------------------------
  - localhost shut off

# ls images/
debdelta-clone-clone-1.img landscape-server.img lucid-lowell-2011-11-23.img
debdelta-clone-clone.img localhost.img lucid-lowell.img
debdelta-clone.img ls-client1.img natty-clone.img
keystone-clone.img ls-client2.img natty.img
keystone.img lucid.img precise.img

tags: added: lucid2precise precise
Revision history for this message
Jamie Strandboge (jdstrand) wrote :

Assuming these are qemu VMs, what is the output of the following commands:
$ virsh -c qemu:///session list --all
$ virsh -c qemu:///system list --all

Changed in libvirt (Ubuntu):
status: New → Incomplete
Revision history for this message
Torsten Spindler (tspindler) wrote :

It seems the config file has changed slightly and the new libvirt on Precise will not accept the one from Lucid. From libvirtd.log:

2012-02-21 11:10:38.183+0000: 11978: error : virDomainDefParseXML:7542 : unsupported configuration: Only the first console can be a serial port
2012-02-21 11:10:38.183+0000: 11978: error : virDomainDefParseXML:7542 : unsupported configuration: Only the first console can be a serial port

The xml config file for the vms created on Lucid contain:

    <console type='pty'>
      <target port='0'/>
    </console>
    <console type='pty'>
      <target port='0'/>
    </console>

The config file for a vm created under Precise contains:

    <serial type='pty'>
      <target port='0'/>
    </serial>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>

When changing the first console tag with serial, the Lucid vm becomes available for me. Thanks to Stefan Bader, who found the double console entry.

Changed in libvirt (Ubuntu):
status: Incomplete → Triaged
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

@Torsten,

Thanks for finding this. This is interesting and may catch some other people.

In the original xml:

<console type='pty'>
      <target port='0'/>
    </console>
    <console type='pty'>
      <target port='0'/>
    </console>

Did libvirt actually do something with the second definition, or did it ignore it? What actually created that xml - was it done by hand, by virtinst, or by virt-manager?

If libvirt actually used to parse this in a way to give you two different consoles, then libvirt in precise should handle this. But if it is just a mistaken duplicate and libvirt used to ignore it, then I'd argue that the errors in the log files are sufficiently clear, and there is no bug here.

Revision history for this message
Torsten Spindler (tspindler) wrote : Re: [Bug 931350] Re: vms missing after upgrade from Lucid to Precise

The config files were generated with virt-manager. The duplicate entry
never caused an issue on Lucid.

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

Quoting Torsten Spindler (<email address hidden>):
> The config files were generated with virt-manager. The duplicate entry
> never caused an issue on Lucid.

Never caused an issue, but that could be seen as a bug in the lucid version,
fixed in precise.

That's why I'm trying to determine whether the duplicate entry was actually
used for something.

If we can do so reliably, we could convert entries on LTS-to-LTS upgrade.

(I don't think we should patch libvirt to ignore the duplicates unless upstream
is willing to take such a patch, which I doubt.)

Revision history for this message
Torsten Spindler (tspindler) wrote :

I've never really used the console of any kvm guest, either used ssh or vnc. As I now no longer have any physical machines running Lucid, I cannot test it, either.

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

Thanks, Torsten. I'll need to investigate further to decide how to best stop the VMs from disappearing.

Changed in libvirt (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Peter Matulis (petermatulis) wrote :

I'm going to apply this bug to release-notes. It's easily fixed but can be a nightmare for some.

Revision history for this message
Peter Matulis (petermatulis) wrote :

FWIW, if you are certain that all XML files need their first 2 occurrences of "console" changed to "serial" then the attached script worked for me.

Revision history for this message
Peter Matulis (petermatulis) wrote :

Release note added:

 * If you are running a KVM host with libvirt and are upgrading from Ubuntu 10.04 LTS to 12.04 LTS you may find that some existing virtual machines are no longer recognized (virsh list --all). A change to each guest's XML file may be in order that is related to how console and serial devices are now configured. (Bug:931350)

Changed in ubuntu-release-notes:
status: New → Fix Released
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

When I create a vm with 'virsh define', I don't get this. It looks like the two console entries could be caused by virt-manager (in lucid)?

Revision history for this message
Kate Stewart (kate.stewart) wrote :

make it explicit this is an issue with precise, and target to the release.

tags: added: rls-q-incoming
tags: removed: rls-q-incoming
Changed in libvirt (Ubuntu Precise):
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Brad Crittenden (bac) wrote :

I was affected by this bug but Peter's script and help solved my problem.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in virt-manager (Ubuntu Precise):
status: New → Confirmed
Changed in virt-manager (Ubuntu):
status: New → Confirmed
Revision history for this message
Matt Rae (mattrae) wrote :

Hi, do we know if this fix will be made automatic so upgrading from 10.04 to 12.04 doesn't need a manual step?

Revision history for this message
RoyK (roysk) wrote :

if all VMs are removed from config after a reboot, this bug really deserves higher priority than just "medium". I'd say "critical"…

Revision history for this message
RoyK (roysk) wrote :

erm, after an "upgrade", that is…

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

@RoyK,

the reason for medium is that there is a workaround, documented in the release notes.

Revision history for this message
MaxNegro (maxnegro) wrote :

Same problem here. All machines were created in lucid via virt-manager, mainly using defaults provided by wizard. I didn't add explicitly any serial console.

Revision history for this message
Tamas Papp (tomposmiko) wrote :

Same problem here, no serial console.

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

@tamas-papp,

did you use virt-manager to create and manage these VMS,

@tamas-papp and @maxnegro,

to make sure, did you both have duplicate serial console entries, and did removing one of those fix it for you? When were the VMs created? Which libvirt+virt-manager versions did you use to create them?

As people are still hitting this, I'm leaning more and more toward an automatic fix.

Revision history for this message
Ralf Heiringhoff (frosty-geek) wrote :

Thanks Peter Matulis (petermatulis) your script from #9 fixed it for me

Revision history for this message
Stefan Bader (smb) wrote :

Lucid is no longer supported and so I would close this. There has been some work-around as far as I can see and by now probably all known vms are likely Precise or newer.

Changed in libvirt (Ubuntu):
status: Triaged → Won't Fix
Changed in libvirt (Ubuntu Precise):
status: Triaged → Won't Fix
Changed in virt-manager (Ubuntu):
status: Confirmed → Won't Fix
Changed in virt-manager (Ubuntu Precise):
status: Confirmed → Won't Fix
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.