How to query Vapp from a VM id

Hi,

This can be helpful if we don't know where we have a virtual machine (in which vapp it is).

First we seek the VM on the virtualmachine table and take note of its idVM, in this example: 1205.

Then we execute this query: 

select * from node n, nodevirtualimage nvi where nvi.idVM = 1205 and nvi.idNode=n.idNode;

We will have an output similar to this:

+--------------+--------+----------+------+------+---------------+-----------------+------+------+-----------+--------+------+---------+-----------+
| idVirtualApp | idNode | modified | posX | posY | type | name | ip | mac | version_c | idNode | idVM | idImage | version_c |
+--------------+--------+----------+------+------+---------------+-----------------+------+------+-----------+--------+------+---------+-----------+
| 585 | 1014 | 0 | 73 | 31 | VIRTUAL_IMAGE | VW2K8_image_UWA | NULL | NULL | 0 | 1014 | 1205 | 469 | 0 |
+--------------+--------+----------+------+------+---------------+-----------------+------+------+-----------+--------+------+---------+-----------+

Have more questions? Submit a request

1 Comments

  • 0
    Avatar
    Sergio Pena

    Inverted query, all vms from a vApp.

    select * from node n join nodevirtualimage nvi on n.idNode = nvi.idNode where n.idVirtualApp = 2349\G;

Please sign in to leave a comment.
Powered by Zendesk