Bug 584777
| Summary: | Problems converting an XM configuration to libvirt XML | ||
|---|---|---|---|
| Product: | [Community] Virtualization Tools | Reporter: | Pierre Riteau <pierre> |
| Component: | libvirt | Assignee: | Libvirt Maintainers <libvirt-maint> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | |
| Severity: | medium | Docs Contact: | |
| Priority: | low | ||
| Version: | unspecified | CC: | crobinso, xen-maint |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2016-04-14 19:59:44 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
Sorry this never received a timely response, but I just tested your config and it appears fixed:
# sudo virsh domxml-from-native xen-xm f
<domain type='xen'>
<name>domU</name>
<uuid>ab6eec38-06ad-4fa6-aa50-4bb3dac321ef</uuid>
<memory unit='KiB'>131072</memory>
<currentMemory unit='KiB'>131072</currentMemory>
<vcpu placement='static'>1</vcpu>
<os>
<type arch='x86_64' machine='xenpv'>linux</type>
<kernel>/boot/vmlinuz-2.6.26-2-xen-amd64</kernel>
<initrd>/boot/initrd.img-2.6.26-2-xen-amd64</initrd>
<cmdline>root=/dev/xvda2 ro (null)</cmdline>
</os>
<clock offset='utc' adjustment='reset'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<disk type='file' device='disk'>
<driver name='file'/>
<source file='/opt/xen/domains/domU/swap.img'/>
<target dev='xvda1' bus='xen'/>
</disk>
<disk type='file' device='disk'>
<driver name='file'/>
<source file='/opt/xen/domains/domU/disk.img'/>
<target dev='xvda2' bus='xen'/>
</disk>
<interface type='bridge'>
<mac address='00:16:3e:70:61:00'/>
<source bridge='xenbr0'/>
</interface>
<console type='pty'>
<target type='xen' port='0'/>
</console>
</devices>
</domain>
Thank you Cole! I am glad to learn it was eventually fixed. Is the "(null)" in "<cmdline>root=/dev/xvda2 ro (null)</cmdline>" expected though? Hmm, I just noticed that. Doesn't seem expected. It may be fixed upstream as well, I was testing on Fedora 22 which has an older libvirt. I'll check it out and open a new bug if necessary Yup, still relevant with upstream. I opened a new bug: https://bugzilla.redhat.com/show_bug.cgi?id=1327578 |
Description of problem: I'm trying to convert the following XM configuration, which works fine with Xen 3.2.1: kernel = '/boot/vmlinuz-2.6.26-2-xen-amd64' ramdisk = '/boot/initrd.img-2.6.26-2-xen-amd64' memory = '128' root = '/dev/xvda2 ro' disk = [ 'file:/opt/xen/domains/domU/swap.img,xvda1,w', 'file:/opt/xen/domains/domU/disk.img,xvda2,w', ] name = 'domU' dhcp = 'dhcp' vif = [ 'mac=00:16:3E:70:61:00,bridge=xenbr0' ] on_poweroff = 'destroy' on_reboot = 'restart' on_crash = 'restart' Version-Release number of selected component (if applicable): 0.8.0 How reproducible: Steps to Reproduce: 1. Copy the above configuration to domU.cfg 2. Run: virsh domxml-from-native xen-xm domU.cfg Actual results: virsh prints: error: Unknown failure Expected results: A libvirt domain XML Additional info: By tracing the code I found that this can be avoided by adding a uuid field in the XM configuration file. In this case, the XML produced is the following: <domain type='xen'> <name>domU</name> <uuid>1e164e3e-880f-2b9f-4247-3d1f0ec6399a</uuid> <memory>131072</memory> <currentMemory>131072</currentMemory> <vcpu>1</vcpu> <os> <type arch='x86_64' machine='xenpv'>linux</type> <kernel>/boot/vmlinuz-2.6.26-2-xen-amd64</kernel> <initrd>/boot/initrd.img-2.6.26-2-xen-amd64</initrd> </os> <clock offset='utc'/> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> <on_crash>restart</on_crash> <devices> <disk type='file' device='disk'> <driver name='file'/> <source file='/opt/xen/domains/domU/swap.img'/> <target dev='xvda1' bus='xen'/> </disk> <disk type='file' device='disk'> <driver name='file'/> <source file='/opt/xen/domains/domU/disk.img'/> <target dev='xvda2' bus='xen'/> </disk> <interface type='bridge'> <mac address='00:16:3e:70:61:00'/> <source bridge='xenbr0'/> </interface> <console type='pty'> <target port='0'/> </console> </devices> </domain> However, this is still unusable since it is missing the "root" information from the XM file. I need to add the following for the VM to boot successfully: <cmdline>root=/dev/xvda2 ro</cmdline>