Ubuntu

vms missing after upgrade from Lucid to Precise

Reported by Torsten Spindler on 2012-02-13
56
This bug affects 10 people
Affects Status Importance Assigned to Milestone
Release Notes for Ubuntu
Undecided
Unassigned
libvirt (Ubuntu)
Medium
Unassigned
Precise
Medium
Unassigned
virt-manager (Ubuntu)
Undecided
Unassigned
Precise
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
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
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
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.

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

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.)

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.

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
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.

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.

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
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)?

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
Brad Crittenden (bac) wrote :

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

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
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?

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"…

RoyK (roysk) wrote :

erm, after an "upgrade", that is…

Serge Hallyn (serge-hallyn) wrote :

@RoyK,

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

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.

Tamas Papp (tamas-papp) wrote :

Same problem here, no serial console.

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.

Ralf Heiringhoff (frosty-geek) wrote :

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

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers