rhevm-shell (CLI) reports VM does not exist when starting a VM

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Virtualization Manager (RHEV) 3.6.7.5
  • The rhevm-shell CLI version:
    rhevm-cli-3.6.2.1-1.el6ev.noarch

Issue

  • VM fails to start from the rhevm-shell CLI with the following error:
[RHEVM shell (connected)]# list vms

id         : 36c5eb20-e32a-42f9-9bf7-6867a6b5ec25
name       : test-VM

[RHEVM shell (connected)]# action vm 36c5eb20-e32a-42f9-9bf7-6867a6b5ec25 start

  =============================== ERROR =======================
     vm 36c5eb20-e32a-42f9-9bf7-6867a6b5ec25 does not exist.
  =============================================================

Resolution

  • BZ 1356607 was added to correct this behaviour and will be addressed in later version of rhevm-cli (RHEV-M version 3.6.8).
  • Current workaround is to downgrade to rhevm-cli-3.6.2.0-1.el6ev.noarch version.

Root Cause

  • In the rhevm-shell CLI, the command line tries to locate an object it tries to do it by id, by name and by alias, but only if the --id, --name or --alias options are part of the command line. This is not correct, for example commands like "action vm" and "show" which don't require any of those options, as the identifier of the object is passed as an argument, not as an option. The result is that the commands don't work and an error is reported.

Diagnostic Steps

  • The RHEV-M server has the followng rhevm-cli rpm version installed.
rhevm-cli-3.6.2.1-1.el6ev.noarch
  • Error reported on both RHEV-M 3.5 and 3.6 versions when starting a VM and also with the show command.
# rhevm-shell -l https://rhev-m.3.5.example.com:443/api --user "admin@internal" --insecure
Password:

  ==================================================
    >>> connected to RHEVM manager 3.5.0.0 <<<
  ==================================================

  ++++++++++++++++++++++++++++++++++++++++++++++++++

          Welcome to RHEVM shell

  ++++++++++++++++++++++++++++++++++++++++++++++++++


[RHEVM shell (connected)]# info

backend version: 3.5
sdk version    : 3.6.7
cli version    : 3.6.2.1
python version : 2.6.6.final.0

entry point    : https://rhev-m.example.com:443/api


[RHEVM shell (connected)]# list vms

id         : 36c5eb20-e32a-42f9-9bf7-6867a6b5ec25
name       : test-vm

[RHEVM shell (connected)]# action vm 36c5eb20-e32a-42f9-9bf7-6867a6b5ec25 start

  =============================== ERROR =======================
     vm 36c5eb20-e32a-42f9-9bf7-6867a6b5ec25 does not exist.
  =============================================================

[RHEVM shell (connected)]# list datacenters

id         : 00000002-0002-0002-0002-0000000001df
name       : Default
description: The default Data Center

[RHEVM shell (connected)]# show datacenter Default

  =============================== ERROR =======================
        datacenter Default does not exist.
  =============================================================
# rhevm-shell -l https://rhev-m.3.6.7.example.com:443/api --user "admin@internal" --insecure
Password: 

  ===================================================================
        >>> connected to RHEVM manager 3.6.7.0 <<<
  ===================================================================

  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

                Welcome to RHEVM shell

  ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


[RHEVM shell (connected)]# info

backend version: 3.6.7
sdk version    : 3.6.7
cli version    : 3.6.2
python version : 2.6.6.final.0

entry point    : https://rhev-m.3.6.7.example.com:443/api

[RHEVM shell (connected)]# list vms

id         : bd0ca0c4-59f8-4085-9bd6-0616fdfea13e
name       : test-vm

[RHEVM shell (connected)]# action vm bd0ca0c4-59f8-4085-9bd6-0616fdfea13e start

  ======================== ERROR ===========================================
     vm bd0ca0c4-59f8-4085-9bd6-0616fdfea13e does not exist.
  ==========================================================================

[RHEVM shell (connected)]# list datacenters

id         : 00000001-0001-0001-0001-0000000002a6
name       : Default
description: The default Data Center

[RHEVM shell (connected)]# show datacenter Default

  ======================== ERROR ===========================================
       datacenter Default does not exist.
  ==========================================================================

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.