-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Description
Description of Issue/Question
Looking at 2018.3, vm_info used to iterate through a list of VM names obtained from list_domains. In 2019.02 vm_info now obtains this list from _get_domains which instead returns a list of domain objects. When the domain object is passed into the functions referenced by vm_info._info (_get_uuid, _get_on_crash, _get_on_reboot, and _get_on_poweroff), _get_domain is eventually called again but with a domain object in *vms instead of a vm's name. _get_domain then checks the contents of *vms against the list all_vms, but fails because the domain object (<libvirt.virDomain object at 0x7fddce314a10>) doesn't match any of the vm names.
Setup
virt.vm_info is failing with the following trace:
salt-minion[18311]: [ERROR ] A command in 'virt.vm_info' had a problem: The VM "<libvirt.virDomain object at 0x7fddce314a10>" is not present
salt-minion[18311]: Traceback (most recent call last):
salt-minion[18311]: File "/usr/lib/python2.7/site-packages/salt/minion.py", line 1660, in _thread_return
salt-minion[18311]: return_data = minion_instance.executors[fname](opts, data, func, args, kwargs)
salt-minion[18311]: File "/usr/lib/python2.7/site-packages/salt/executors/direct_call.py", line 12, in execute
salt-minion[18311]: return func(*args, **kwargs)
salt-minion[18311]: File "/usr/lib/python2.7/site-packages/salt/modules/virt.py", line 2034, in vm_info
salt-minion[18311]: info[domain.name()] = _info(domain)
salt-minion[18311]: File "/usr/lib/python2.7/site-packages/salt/modules/virt.py", line 2021, in _info
salt-minion[18311]: 'uuid': _get_uuid(dom),
salt-minion[18311]: File "/usr/lib/python2.7/site-packages/salt/modules/virt.py", line 336, in _get_uuid
salt-minion[18311]: return ElementTree.fromstring(get_xml(dom)).find('uuid').text
salt-minion[18311]: File "/usr/lib/python2.7/site-packages/salt/modules/virt.py", line 2452, in get_xml
salt-minion[18311]: xml_desc = get_domain(conn, vm).XMLDesc(0)
salt-minion[18311]: File "/usr/lib/python2.7/site-packages/salt/modules/virt.py", line 273, in _get_domain
salt-minion[18311]: raise CommandExecutionError('The VM "{name}" is not present'.format(name=name))
salt-minion[18311]: CommandExecutionError: The VM "<libvirt.virDomain object at 0x7fddce314a10>" is not present
Steps to Reproduce Issue
Versions Report
salt-master
Salt Version:
Salt: 2019.2.0
Dependency Versions:
cffi: 1.6.0
cherrypy: Not Installed
dateutil: 1.5
docker-py: Not Installed
gitdb: Not Installed
gitpython: Not Installed
ioflo: Not Installed
Jinja2: 2.7.2
libgit2: Not Installed
libnacl: Not Installed
M2Crypto: 0.31.0
Mako: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.5.6
mysql-python: Not Installed
pycparser: 2.14
pycrypto: 2.6.1
pycryptodome: Not Installed
pygit2: Not Installed
Python: 2.7.5 (default, Oct 30 2018, 23:45:53)
python-gnupg: Not Installed
PyYAML: 3.11
PyZMQ: 15.3.0
RAET: Not Installed
smmap: Not Installed
timelib: Not Installed
Tornado: 4.2.1
ZMQ: 4.1.4
System Versions:
dist: centos 7.6.1810 Core
locale: UTF-8
machine: x86_64
release: 3.10.0-957.10.1.el7.x86_64
system: Linux
version: CentOS Linux 7.6.1810 Core
Minion running libvirtd:
Salt Version:
Salt: 2019.2.0
Dependency Versions:
cffi: 1.6.0
cherrypy: Not Installed
dateutil: 1.5
docker-py: Not Installed
gitdb: Not Installed
gitpython: Not Installed
ioflo: Not Installed
Jinja2: 2.7.2
libgit2: Not Installed
libnacl: Not Installed
M2Crypto: 0.31.0
Mako: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.5.6
mysql-python: Not Installed
pycparser: 2.14
pycrypto: 2.6.1
pycryptodome: Not Installed
pygit2: Not Installed
Python: 2.7.5 (default, Oct 30 2018, 23:45:53)
python-gnupg: Not Installed
PyYAML: 3.11
PyZMQ: 15.3.0
RAET: Not Installed
smmap: Not Installed
timelib: Not Installed
Tornado: 4.2.1
ZMQ: 4.1.4
System Versions:
dist: centos 7.6.1810 Core
locale: UTF-8
machine: x86_64
release: 3.10.0-957.10.1.el7.x86_64
system: Linux
version: CentOS Linux 7.6.1810 Core
libvirt packages installed:
rpm -qa | grep -i libvirt
libvirt-libs-4.5.0-10.el7_6.6.x86_64
libvirt-daemon-driver-qemu-4.5.0-10.el7_6.6.x86_64
libvirt-daemon-config-nwfilter-4.5.0-10.el7_6.6.x86_64
libvirt-daemon-driver-storage-disk-4.5.0-10.el7_6.6.x86_64
libvirt-daemon-driver-network-4.5.0-10.el7_6.6.x86_64
libvirt-daemon-driver-interface-4.5.0-10.el7_6.6.x86_64
libvirt-daemon-driver-storage-rbd-4.5.0-10.el7_6.6.x86_64
libvirt-client-4.5.0-10.el7_6.6.x86_64
libvirt-daemon-driver-storage-core-4.5.0-10.el7_6.6.x86_64
libvirt-daemon-driver-secret-4.5.0-10.el7_6.6.x86_64
libvirt-daemon-config-network-4.5.0-10.el7_6.6.x86_64
libvirt-daemon-driver-storage-gluster-4.5.0-10.el7_6.6.x86_64
libvirt-daemon-kvm-4.5.0-10.el7_6.6.x86_64
libvirt-bash-completion-4.5.0-10.el7_6.6.x86_64
libvirt-daemon-4.5.0-10.el7_6.6.x86_64
libvirt-daemon-driver-nodedev-4.5.0-10.el7_6.6.x86_64
libvirt-python-4.5.0-1.el7.x86_64
libvirt-daemon-driver-lxc-4.5.0-10.el7_6.6.x86_64
libvirt-daemon-driver-storage-iscsi-4.5.0-10.el7_6.6.x86_64
libvirt-daemon-driver-storage-4.5.0-10.el7_6.6.x86_64
libvirt-docs-4.5.0-10.el7_6.6.x86_64
libvirt-daemon-driver-nwfilter-4.5.0-10.el7_6.6.x86_64
libvirt-daemon-driver-storage-mpath-4.5.0-10.el7_6.6.x86_64
libvirt-daemon-driver-storage-logical-4.5.0-10.el7_6.6.x86_64
libvirt-daemon-driver-storage-scsi-4.5.0-10.el7_6.6.x86_64
libvirt-4.5.0-10.el7_6.6.x86_64