Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

virt.full_info fixes #54335

Merged
merged 2 commits into from
Dec 20, 2019
Merged

virt.full_info fixes #54335

merged 2 commits into from
Dec 20, 2019

Commits on Dec 20, 2019

  1. Add virt.full_info test

    Replace a few tests on parts of the virt.full_info feature by a complete
    test of virt.full_info
    cbosdo committed Dec 20, 2019
    Configuration menu
    Copy the full SHA
    7e065a1 View commit details
    Browse the repository at this point in the history
  2. qemu-img info needs -U flag on running VMs

    When getting VM disks informations on a running VM, the following error
    occured:
    
        The minion function caused an exception: Traceback (most recent call last):
          File "/usr/lib/python3.6/site-packages/salt/minion.py", line 1673, in _thread_return
            return_data = minion_instance.executors[fname](opts, data, func, args, kwargs)
          File "/usr/lib/python3.6/site-packages/salt/executors/direct_call.py", line 12, in execute
            return func(*args, **kwargs)
          File "/usr/lib/python3.6/site-packages/salt/modules/virt.py", line 2411, in full_info
            'vm_info': vm_info()}
          File "/usr/lib/python3.6/site-packages/salt/modules/virt.py", line 2020, in vm_info
            info[domain.name()] = _info(domain)
          File "/usr/lib/python3.6/site-packages/salt/modules/virt.py", line 2004, in _info
            'disks': _get_disks(dom),
          File "/usr/lib/python3.6/site-packages/salt/modules/virt.py", line 465, in _get_disks
            output = _parse_qemu_img_info(qemu_output)
          File "/usr/lib/python3.6/site-packages/salt/modules/virt.py", line 287, in _parse_qemu_img_info
            raw_infos = salt.utils.json.loads(info)
          File "/usr/lib/python3.6/site-packages/salt/utils/json.py", line 92, in loads
            return json_module.loads(s, **kwargs)
          File "/usr/lib64/python3.6/json/__init__.py", line 354, in loads
            return _default_decoder.decode(s)
          File "/usr/lib64/python3.6/json/decoder.py", line 339, in decode
            obj, end = self.raw_decode(s, idx=_w(s, 0).end())
          File "/usr/lib64/python3.6/json/decoder.py", line 357, in raw_decode
            raise JSONDecodeError("Expecting value", s, err.value) from None
        json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
    
    This is due to the fact that qemu-img can't get infos on a disk that is
    already used like by a running VM. Using the qemu-img -U flag gets it
    running in all cases.
    cbosdo committed Dec 20, 2019
    Configuration menu
    Copy the full SHA
    f4ffd37 View commit details
    Browse the repository at this point in the history