Bug 820873 - The "long" option doesn't work with "xl list" on opensuse 12.3
The "long" option doesn't work with "xl list" on opensuse 12.3
Status: RESOLVED FIXED
Classification: openSUSE
Product: openSUSE 12.3
Classification: openSUSE
Component: Xen
Final
Other openSUSE 12.3
: P5 - None : Major (vote)
: ---
Assigned To: Chunyan Liu
E-mail List
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-21 03:42 UTC by Ralph Schaffner
Modified: 2015-02-19 04:17 UTC (History)
2 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
Xen xm formatted config file (481 bytes, application/octet-stream)
2013-06-12 15:12 UTC, Ralph Schaffner
Details
Libvirt formatted config file (1.08 KB, application/octet-stream)
2013-06-12 15:16 UTC, Ralph Schaffner
Details
Fix for stable versions. Show empty info instead of improper "domain name not specified" error (649 bytes, patch)
2014-07-28 07:34 UTC, Chunyan Liu
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ralph Schaffner 2013-05-21 03:42:45 UTC
The "long" option for displaying VM details doesn't work with "xl list" on opensuse 12.3

homevhst01:~ # xl list smt
Name                                        ID   Mem VCPUs      State   Time(s)
smt                                          1   512     1     -b----     861.4
homevhst01:~ # xl list -l smt
Domain name must be specified.
homevhst01:~ # xl list smt -l
Usage: xl [-v] list [options] [Domain]


List information about all/some domains.

Options:

-l, --long              Output all VM details
-v, --verbose           Prints out UUIDs and security context
-Z, --context           Prints out security context
homevhst01:~ # which xl
/usr/sbin/xl
homevhst01:~ # rpm -qf /usr/sbin/xl
xen-tools-4.2.1_12-1.8.1.x86_64
homevhst01:~ #
Comment 2 James Fehlig 2013-06-11 14:29:58 UTC
Hmm, with the latest 12.3 Xen packages I'm not seeing this issue

# xl list opensuse12.3-pv
Name                                        ID   Mem VCPUs	State	Time(s)
opensuse12.3-pv                              1   768     1     -b----      14.2

# xl list -l opensuse12.3-pv
[{"domid":1,"config":{"c_info":{"type":"pv","hap":"<default>","oos":"<default>","ssidref":0,"name":"opensuse12.3-pv","uuid":"e42394ee-3633-6c8c-724a-04d4cb386c66","xsdata":{},"platformdata":{},"poolid":0,"run_hotplug_scripts":"True"},"b_info":{"max_vcpus":1,"avail_vcpus":[0],"cpumap":[],"numa_placement":"<default>","tsc_mode":"default","max_memkb":786432,"target_memkb":786432,"video_memkb":-1,"shadow_memkb":7168,"rtc_timeoffset":0,"localtime":"False","disable_migrate":"<default>","cpuid":[],"blkdev_start":null,"device_model_version":null,"device_model_stubdomain":"<default>","device_model":null,"device_model_ssidref":0,"extra":[],"extra_pv":[],"extra_hvm":[],"sched_params":{"sched":"unknown","weight":-1,"cap":-1,"period":-1,"slice":-1,"latency":-1,"extratime":-1},"ioports":[],"irqs":[],"u":{"kernel":null,"slack_memkb":-1,"bootloader":"/usr/bin/pygrub","bootloader_args":[],"cmdline":" ","ramdisk":null,"e820_host":"<default>"}},"disks":[{"backend_domid":0,"pdev_path":"/var/lib/xen/images/opensuse12.3-pv/disk0.raw","vdev":"xvda","backend":"unknown","format":"raw","script":null,"removable":0,"readwrite":1,"is_cdrom":0}],"nics":[{"backend_domid":0,"devid":0,"mtu":0,"model":null,"mac":"00:16:3e:72:b4:5b","ip":null,"bridge":"br0","ifname":null,"script":null,"nictype":null,"rate_bytes_per_interval":0,"rate_interval_usecs":0}],"pcidevs":[],"vfbs":[{"backend_domid":0,"devid":0,"vnc":{"enable":"<default>","listen":null,"passwd":null,"display":0,"findunused":"True"},"sdl":{"enable":"<default>","opengl":"<default>","display":null,"xauthority":null},"keymap":null}],"vkbs":[{"backend_domid":0,"devid":0}],"on_poweroff":"destroy","on_reboot":"restart","on_watchdog":"destroy","on_crash":"destroy"}}]

The json output could be "prettified", but I see that has been done in Xen 4.3, e.g.

# xl list --long opensuse12.3-pv
[
    {
        "domid": 1,
        "config": {
            "c_info": {
                "type": "pv",
                "hap": "<default>",
                "oos": "<default>",
                "ssidref": 0,
                "name": "opensuse12.3-pv",
                "uuid": "e42394ee-3633-6c8c-724a-04d4cb386c66",
                "xsdata": {

                },
                "platformdata": {

                },
                "poolid": 0,
                "run_hotplug_scripts": "True"
            },
            "b_info": {
                "max_vcpus": 1,
                "avail_vcpus": [
                    0
                ],
                "cpumap": [

                ],
                "nodemap": [

                ],
                "numa_placement": "<default>",
                "tsc_mode": "default",
                "max_memkb": 786432,
                "target_memkb": 786432,
                "video_memkb": -1,
                "shadow_memkb": 7168,
                "rtc_timeoffset": 0,
                "exec_ssidref": 0,
                "localtime": "False",
                "disable_migrate": "<default>",
                "cpuid": [

                ],
                "blkdev_start": null,
                "device_model_version": null,
                "device_model_stubdomain": "<default>",
                "device_model": null,
                "device_model_ssidref": 0,
                "extra": [

                ],
                "extra_pv": [

                ],
                "extra_hvm": [

                ],
                "sched_params": {
                    "sched": "unknown",
                    "weight": -1,
                    "cap": -1,
                    "period": -1,
                    "slice": -1,
                    "latency": -1,
                    "extratime": -1
                },
                "ioports": [

                ],
                "irqs": [

                ],
                "iomem": [

                ],
                "claim_mode": "False",
                "u": {
                    "kernel": null,
                    "slack_memkb": -1,
                    "bootloader": "/usr/bin/pygrub",
                    "bootloader_args": [

                    ],
                    "cmdline": " ",
                    "ramdisk": null,
                    "e820_host": "<default>"
                }
            },
            "disks": [
                {
                    "backend_domid": 0,
                    "backend_domname": null,
                    "pdev_path": "/var/lib/xen/images/opensuse12.3-pv/disk0.raw",
                    "vdev": "xvda",
                    "backend": "unknown",
                    "format": "raw",
                    "script": null,
                    "removable": 0,
                    "readwrite": 1,
                    "is_cdrom": 0
                }
            ],
            "nics": [
                {
                    "backend_domid": 0,
                    "backend_domname": null,
                    "devid": 0,
                    "mtu": 0,
                    "model": null,
                    "mac": "00:16:3e:72:b4:5b",
                    "ip": null,
                    "bridge": "br0",
                    "ifname": null,
                    "script": null,
                    "nictype": null,
                    "rate_bytes_per_interval": 0,
                    "rate_interval_usecs": 0,
                    "gatewaydev": null
                }
            ],
            "pcidevs": [

            ],
            "vfbs": [
                {
                    "backend_domid": 0,
                    "backend_domname": null,
                    "devid": 0,
                    "vnc": {
                        "enable": "<default>",
                        "listen": null,
                        "passwd": null,
                        "display": 0,
                        "findunused": "True"
                    },
                    "sdl": {
                        "enable": "<default>",
                        "opengl": "<default>",
                        "display": null,
                        "xauthority": null
                    },
                    "keymap": null
                }
            ],
            "vkbs": [
                {
                    "backend_domid": 0,
                    "backend_domname": null,
                    "devid": 0
                }
            ],
            "vtpms": [

            ],
            "on_poweroff": "destroy",
            "on_reboot": "restart",
            "on_watchdog": "destroy",
            "on_crash": "destroy"
        }
    }
]

Do you still have the problem with latest 12.3 updates?
Comment 3 Ralph Schaffner 2013-06-11 20:38:37 UTC
Yes, I still have the problem with the latest updates. What version of xen-tools are you running?

homevhst01:~/devel/systemd # xl list smt
Name                                        ID   Mem VCPUs      State   Time(s)
smt                                          1   512     1     -b----      36.9
homevhst01:~/devel/systemd # xl list -l smt
Domain name must be specified.
homevhst01:~/devel/systemd # xl list smt -l
Usage: xl [-v] list [options] [Domain]


List information about all/some domains.

Options:

-l, --long              Output all VM details
-v, --verbose           Prints out UUIDs and security context
-Z, --context           Prints out security context
homevhst01:~/devel/systemd # which xl
/usr/sbin/xl
homevhst01:~/devel/systemd # rpm -qf /usr/sbin/xl
xen-tools-4.2.1_12-1.12.10.x86_64
homevhst01:~/devel/systemd #
Comment 4 James Fehlig 2013-06-12 06:44:15 UTC
Perhaps you have some domain config that causes the 'xl list' code to barf.  Can you provide the domain config file?  With your config, I assume reproducing is as simple as 'xl create config.file; sleep; xl list dom-name'?

> What version of xen-tools are you running?

Currently the system has xen-tools-4.3.0_03-248.1.x86_64 from the Virtualization project in OBS.  But I also tried with the latest xen-tools package from the updates (http://download.opensuse.org/update/12.3/x86_64/xen-tools-4.2.1_12-1.8.1.x86_64.rpm)
Comment 5 Ralph Schaffner 2013-06-12 15:12:55 UTC
Created attachment 543896 [details]
Xen xm formatted config file

Actually I use virsh for starting my VMs and the long list option doesn't work with any of them.

After upgrading my homevhst to os12.3, I took my xm formatted config files and converted them to libvirt formatted xml using "virsh domxml-from-native". I then used "virsh define" to add them to libvirt.

I can do most things through virsh and libvirt but some things are not yet supported (ex. "virsh console" does not work) which means I need to use xl.

I would assume that xl is pulling the information from xenstore and not from a config file so I would assume it doesn't matter but maybe I'm wrong.

I've attached the original xm formatted config file.
Comment 6 Ralph Schaffner 2013-06-12 15:16:41 UTC
Created attachment 543898 [details]
Libvirt formatted config file

This is the output generated by virsh from the original xm formatted config and what I then added to libvirt using "virsh define"

This is what is used to start the VM. The VM defined by these config files is actually set to autostart on boot through libvirt which works fine.
Comment 7 Ralph Schaffner 2013-06-12 15:26:25 UTC
Ok, it looks like the problem is in the libvirtd libxl driver.

"xl list -l" only works if the VM is started by xl.

homevhst01:~/devel # xl create /etc/xen/vm/source
Parsing config from /etc/xen/vm/source
libxl: warning: libxl_bootloader.c:413:bootloader_disk_attached_cb: bootloader='/usr/bin/pygrub' is deprecated; use bootloader='pygrub' instead
Daemon running with PID 14687
homevhst01:~/devel # xl list
Name                                        ID   Mem VCPUs      State   Time(s)
Domain-0                                     0  6036     4     r-----     779.6
smt                                          1   512     1     -b----     244.3
dlnaserver01                                 5   768     1     -b----      15.3
source                                       6   512     1     -b----       1.3
homevhst01:~/devel # xl list -l source
[{"domid":6,"config":{"c_info":{"type":"pv","hap":"<default>","oos":"<default>","ssidref":0,"name":"source","uuid":"1d0f6ad8-5750-f6da-32cd-c92f3e56cb4e","xsdata":{},"platformdata":{},"poolid":0,"run_hotplug_scripts":"True"},"b_info":{"max_vcpus":1,"avail_vcpus":[0],"cpumap":[1],"numa_placement":"False","tsc_mode":"default","max_memkb":524288,"target_memkb":524288,"video_memkb":-1,"shadow_memkb":5120,"rtc_timeoffset":0,"localtime":"False","disable_migrate":"<default>","cpuid":[],"blkdev_start":null,"device_model_version":null,"device_model_stubdomain":"<default>","device_model":null,"device_model_ssidref":0,"extra":[],"extra_pv":[],"extra_hvm":[],"sched_params":{"sched":"unknown","weight":-1,"cap":-1,"period":-1,"slice":-1,"latency":-1,"extratime":-1},"ioports":[],"irqs":[],"u":{"kernel":null,"slack_memkb":-1,"bootloader":"/usr/bin/pygrub","bootloader_args":[],"cmdline":" ","ramdisk":null,"e820_host":"<default>"}},"disks":[{"backend_domid":0,"pdev_path":"/var/lib/xen/images/source/disk0.qcow2","vdev":"xvda","backend":"unknown","format":"qcow2","script":null,"removable":0,"readwrite":1,"is_cdrom":0}],"nics":[{"backend_domid":0,"devid":0,"mtu":0,"model":null,"mac":"00:16:3e:40:93:e3","ip":null,"bridge":"br0","ifname":null,"script":null,"nictype":null,"rate_bytes_per_interval":0,"rate_interval_usecs":0}],"pcidevs":[],"vfbs":[{"backend_domid":0,"devid":0,"vnc":{"enable":"<default>","listen":null,"passwd":null,"display":0,"findunused":"True"},"sdl":{"enable":"<default>","opengl":"<default>","display":null,"xauthority":null},"keymap":null}],"vkbs":[{"backend_domid":0,"devid":0}],"on_poweroff":"destroy","on_reboot":"restart","on_watchdog":"destroy","on_crash":"destroy"}}]
homevhst01:~/devel # xl list -l smt
Domain name must be specified.
homevhst01:~/devel #
Comment 8 Ralph Schaffner 2013-06-12 15:30:39 UTC
Of course, if I start them with xl then libvirt doesn't see them.

homevhst01:~/devel # virsh list
 Id    Name                           State
----------------------------------------------------
 1     smt                            running
 5     dlnaserver01                   running

homevhst01:~/devel # virsh list --all
 Id    Name                           State
----------------------------------------------------
 1     smt                            running
 5     dlnaserver01                   running
 -     cloud01                        shut off
 -     cloud02                        shut off
 -     cloud03                        shut off
 -     desktop                        shut off
 -     laptop                         shut off
 -     lisa01                         shut off
 -     node1                          shut off
 -     node2                          shut off
 -     secure                         shut off
 -     source                         shut off
 -     videotc                        shut off

homevhst01:~/devel # xl list
Name                                        ID   Mem VCPUs      State   Time(s)
Domain-0                                     0  6036     4     r-----     786.3
smt                                          1   512     1     -b----     244.7
dlnaserver01                                 5   768     1     -b----      15.9
source                                       6   512     1     -b----       5.3
homevhst01:~/devel #
Comment 9 James Fehlig 2013-06-13 09:33:21 UTC
(In reply to comment #5)
> Actually I use virsh for starting my VMs and the long list option doesn't work
> with any of them.

There are no guarantees libvirt and xl will play nicely together.  These are two different libxl applications, neither of which is aware that the other exits.

libxl supports the notion of "user data", where applications can store private data related to a domain.  xl stores its data with userid "xl".  libvirt stores its data with userid "libvirt-xml".  The bug you are seeing is xl unable to find its user data.

(In reply to comment #7)
> Ok, it looks like the problem is in the libvirtd libxl driver.
> "xl list -l" only works if the VM is started by xl.

No problem in the libvirt libxl driver.  IMO, the bug here is that xl could report a better error message, e.g. "No xl user data found. Is this domain managed by another libxl application?".

(In reply to comment #8)
> Of course, if I start them with xl then libvirt doesn't see them.

That's correct.  libvirt will only know about domains started by libvirt, similar to the qemu driver where domains started with e.g. 'qemu-kvm ...' are unknown to libvirt.

Again, I think the bug here is an unclear error message from xl.  Do you agree?
Comment 10 James Fehlig 2013-10-15 03:07:34 UTC
Bamvor, can you look at this bug?  See my comment above.  I think xl behavior should be improved when e.g. doing 'xl list --long' on a domain not created by libxl (aka a 'foreign' domain).  IMO, the bug can be closed after fixing it upstream and backporting the fix to Factory.  Thanks!
Comment 11 Bamvor Jian Zhang 2013-10-15 06:27:19 UTC
(In reply to comment #5)
> Created an attachment (id=543896) [details]
> Xen xm formatted config file
> 
> Actually I use virsh for starting my VMs and the long list option doesn't work
> with any of them.
> 
> After upgrading my homevhst to os12.3, I took my xm formatted config files and
> converted them to libvirt formatted xml using "virsh domxml-from-native". I
> then used "virsh define" to add them to libvirt.
> 
> I can do most things through virsh and libvirt but some things are not yet
> supported (ex. "virsh console" does not work) which means I need to use xl.
the virsh console command is upstreamed right now.
do u have anyother command must use xl cli with the details from "xl list -l"? 
the details of vm could get from virsh dumpxml domain_name or xenstore-ls. is it enough for you? 
> 
> I would assume that xl is pulling the information from xenstore and not from a
> config file so I would assume it doesn't matter but maybe I'm wrong.
> 
> I've attached the original xm formatted config file.
Comment 14 Ralph Schaffner 2013-10-15 18:00:18 UTC
(In reply to comment #11)
> the virsh console command is upstreamed right now.
> do u have anyother command must use xl cli with the details from "xl list -l"? 
> the details of vm could get from virsh dumpxml domain_name or xenstore-ls. is
> it enough for you? 

I'm sure there are other ways to get the same information but I was looking for some consistency. Prior to upgrading to opensuse 12.3, I didn't use virsh or libvirt. I could use virt-manager and vm-install to create VMs and manage them with xm.

After upgrading to opensuse 12.3, virt-manager and vm-install use libvirt. This is currently pushing me towards libvirtd and virsh but I still have VMs that were created prior to my upgrade and exist outside libvirtd control.

I was hoping I could still maintain the same workflow and simply replace xm with xl but I guess that isn't going to be possible. I suspect I will end up migrating everything to virsh and libvirtd but until the upstream code for "virsh console" makes it's way into opensuse, I will continue to have to use a mix of commands.

But as James said, useful/informative error messages are always preferred.
Comment 15 Ralph Schaffner 2013-10-15 18:06:12 UTC
This may actually be a feature request but if xl is suppose to be a generic tool for working with libxl, it might make sense for xl to be able to view or dump data created by libxl even if it is from another toolstack that uses libxl.
Comment 16 James Fehlig 2013-10-17 18:55:13 UTC
(In reply to comment #14)
> After upgrading to opensuse 12.3, virt-manager and vm-install use libvirt.

virt-manager and vm-install have always used libvirt.  What did change in 12.3 is moving the libvirt xen driver from libvirt-client to libvirtd.  So libvirtd is now required on xen hosts even when using the legacy xend driver.  It has always been required when using the libxl stack.

> This
> is currently pushing me towards libvirtd and virsh but I still have VMs that
> were created prior to my upgrade and exist outside libvirtd control.

xl is supposed to be compatible with xm, so your existing tooling/scripts should still work.  That said, I'd suggesting using libvirt anyhow since it will provide a stable interface even when upstream Xen swaps one toolstack for another.

> I was hoping I could still maintain the same workflow and simply replace xm
> with xl but I guess that isn't going to be possible.

Are there specific issues preventing this?  As mentioned above, upstream Xen strives for xl compatibility with xm.

> until the upstream code for
> "virsh console" makes it's way into opensuse

Will be included in 13.1.  FYI, if you live on the bleeding edge, the OBS Virtualization project always contains the latest, SUSE-packaged libvirt, which e.g. contains Bamvor's console patches

https://build.opensuse.org/package/show/Virtualization/libvirt
Comment 17 James Fehlig 2013-10-17 19:02:40 UTC
(In reply to comment #15)
> This may actually be a feature request but if xl is suppose to be a generic
> tool for working with libxl

I don't think that is the purpose of xl - it is simply an "in-tree" libxl app AFAIK.  But that would need to be verified with the upstream Xen community.

But I think the problem here is with the notion "user data" that libxl supports.  Apps can store domain-specific private data with libxl, and I suspect xl is choking on the user data provided by libvirt.  It should ignore this data IMO, and print a message that the domain is unknown or foreign to xl.
Comment 18 Ralph Schaffner 2013-10-17 19:24:06 UTC
(In reply to comment #16)
> > I was hoping I could still maintain the same workflow and simply replace xm
> > with xl but I guess that isn't going to be possible.
> 
> Are there specific issues preventing this?  As mentioned above, upstream Xen
> strives for xl compatibility with xm.
> 

Well, since the point of the bug is that I can't do a long list using xl on VMs created using vm-install which is something I could do with with xm, I'd say that is a fairly specific issue preventing me from maintaining the same workflow. ;)

Prior to opensuse 12.3, I used to use virt-manager and vm-install for creating VMs and then managed them using xm. I can't just swap out xl for xm and keep doing that. Before 12.3, I didn't use virsh.
Comment 19 James Fehlig 2013-10-17 19:38:59 UTC
(In reply to comment #18)
> Well, since the point of the bug is that I can't do a long list using xl on VMs
> created using vm-install which is something I could do with with xm, I'd say
> that is a fairly specific issue preventing me from maintaining the same
> workflow. ;)

Hehe, touche.

But really the problem here is with the workflow.  You shouldn't mix and match toolstacks.
Comment 20 Bamvor Jian Zhang 2014-03-10 05:59:30 UTC
after discuss with xen upstream, there are more than one reasons could lead to the empty message your report. so we could not just report a warning. because we do not know the specific reasons.
Comment 21 Chunyan Liu 2014-07-24 06:28:13 UTC
Upstream Wei Liu's "libxl: synchronise domain configuration" series solved this
issue perfectly. That will save config data in libxl so that 'xl list --long" can list libvirt domains too.
http://lists.xenproject.org/archives/html/xen-devel/2014-07/msg01433.html
Comment 22 Chunyan Liu 2014-07-28 07:34:56 UTC
Created attachment 600023 [details]
Fix for stable versions. Show empty info instead of improper "domain name not specified" error

Since upstream "sync domain configuration" patch series depends on json patch series, quite many things for backport. Upstream acked this patch, which could be
backported to current stable versions. For future stable xen version, "sync domain configuration" patch series will be included.
Comment 23 Chunyan Liu 2014-07-28 07:39:40 UTC
I'll backport this patch to openSUSE-12.3, openSUSE-13.1 and SLE-12.
Test repo could be:
http://download.opensuse.org/repositories/home:/cyliu:/branches:/OBS_Maintained:/xen/openSUSE_12.3_Update/
Comment 25 Swamp Workflow Management 2014-10-09 11:05:19 UTC
openSUSE-SU-2014:1279-1: An update that solves 10 vulnerabilities and has 8 fixes is now available.

Category: security (important)
Bug References: 798770,820873,833483,842006,858178,862608,864801,865682,867910,878841,880751,881900,891539,895798,895799,895802,896023,897657
CVE References: CVE-2013-4344,CVE-2013-4540,CVE-2014-2599,CVE-2014-3967,CVE-2014-3968,CVE-2014-4021,CVE-2014-7154,CVE-2014-7155,CVE-2014-7156,CVE-2014-7188
Sources used:
openSUSE 12.3 (src):    xen-4.2.4_04-1.32.1
Comment 26 Swamp Workflow Management 2014-10-09 11:09:28 UTC
openSUSE-SU-2014:1281-1: An update that solves 10 vulnerabilities and has four fixes is now available.

Category: security (important)
Bug References: 798770,820873,842006,864801,865682,875668,878841,880751,882127,895798,895799,895802,896023,897657
CVE References: CVE-2013-4344,CVE-2013-4540,CVE-2014-3124,CVE-2014-3967,CVE-2014-3968,CVE-2014-4021,CVE-2014-7154,CVE-2014-7155,CVE-2014-7156,CVE-2014-7188
Sources used:
openSUSE 13.1 (src):    xen-4.3.2_02-27.1