"vdsClient -s 0 list table" command is not listing the VMs which are down.

Latest response

Hi,
I tried to list all the VMs running on a specific host using the following vdsClient command. But it is showing only the VMs which are "UP"
"vdsClient -s 0 list table"

When the RHV-Manager is down,
1) How to list all the VMs (regardless the VM is up or down) running on a host?
2) How to manually start/shutdown/poweroff the VM using vdsClient?
3) How to get the MAC addresses of all the nics present on all the VMs on a specific host?
4) Is there any other tool similar to vdsClient to get the VM information when the RHV-Manager is down?

Thanks.

Responses

Hello,

In response:

1) How to list all the VMs (regardless the VM is up or down) running on a host?

vdsClient will only list the running VMs. VM's are only associated with a host if they are running, so it's not possible to report on VM's that are down. The only exception to this would be the HostedEngine instance.

2) How to manually start/shutdown/poweroff the VM using vdsClient?

This is not possible. VM's must be started via the GUI or API (the API requires ovirt-engine to be running)

3) How to get the MAC addresses of all the nics present on all the VMs on a specific host?

# vdsClient -s 0 list| grep -o -E '([[:xdigit:]]{1,2}:){5}[[:xdigit:]]{1,2}|vmName.*'

It's difficult to parse the output nicely, not sure if there is an easier way.

4) Is there any other tool similar to vdsClient to get the VM information when the RHV-Manager is down?

vdsClient is the only tool that I am aware of, other than general OS tools ('ps', 'lsof', etc...)

'virsh' may be useful in some limited instances, ie:

  • Another way to list running VM's
# virsh -r list                                        
  • Show the current running VM config - xml format.
# virsh -r dumpxml <vm-name>      

Hello Marcus,

Thanks for your reply. But I'm able to shutdown/reboot VMs using vdsClient tool as shown below.

[root@host124 ~]# vdsClient -s 0 shutdown
Error using command: need more than 0 values to unpack

shutdown
        <vmId> <delay> <message> [reboot:bool] [timeout] [force:bool]
        Stops the emulation and graceful shutdown the virtual machine.
        o reboot: if specified, reboot instead of shutdown (default False)
        o timeout: number of seconds to wait before proceeding to next shutdown/reboot method
        o force: if specified, forcefuly reboot/shutdown after all graceful methods fail (default False)

[root@host124 ~]# vdsClient -s 0 shutdown 92281f1d-f1b6-435e-9c34-3a2559a89bc9 10 abcdefg
Machine shutting down

[root@host124 ~]# vdsClient -s 0 shutdown 92281f1d-f1b6-435e-9c34-3a2559a89bc9 10 abcedfg True
Machine rebooting

But I'm not able to figure out how to start the VM (that is being shutdown) using this command.

Hello,

Sorry I was focusing on the request to start VM's. Yes there is a 'shutdown' command and in theory it can be done without ovirt-engine's knowledge. (not much different to shutting the VM down itself, or killing the process on the hypervisor). The engine would just see this changed state and update accordingly.

Starting the VM, however, is different. It must be controlled by the engine, otherwise you could easily start the same VM on two different hypervisors simultaneously. This would result in the VM's disk being mounted and modified by two different instances, and then filesystem corruption.

Close

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