On AdminPortal, you see that the VM status becomes unknown with a black question mark and all operations become grey and no operation can be done on this VM as follows:

unknown

This post will show you how to reset state of vm in the engine databse and run the VM again.

1. Follow the below post steps to connect to the Postgres engine database.

Useful RHV Engine PostgreSQL Database Queries

2. Check the VM status in Databse:

# select a.vm_guid,a.vm_name,b.status,c.vds_name from vm_static a, vm_dynamic b,vds_static c where a.vm_guid=b.vm_guid and b.run_on_vds=c.vds_id ;

For example:

engine=# select a.vm_guid,a.vm_name,b.status,c.vds_name from vm_static a, vm_dynamic b,vds_static c where a.vm_guid=b.vm_guid and b.run_on_vds=c.vds_id ;
vm_guid | vm_name | status | vds_name
----------------------------+---------+--------+--------------------------
xxx-xxx-xxx-xxx-xxx | VM1 | 1 | KVM Host1
xxx-xxx-xxx-xxx-xxx | VM2 | 1 | KVM Host2
xxx-xxx-xxx-xxx-xxx | VM3 | 7 | KVM Host3         >>>>>>>>>> Status 7 indicates that the VM is in unknown.
(3 rows)

3. Take a backup of the current database following the below post:

How to Backup And Restore The RHEV Manager Engine

4. Update the VM status in the database:

# update vm_dynamic set status = 0 where vm_guid =(select vm_guid from vm_static where vm_name="");

For example:

engine=# update vm_dynamic set status = 0 where vm_guid =(select vm_guid from vm_static where vm_name="VM3");
UPDATE 1

5. Check the current VM status in the AdminPortal and it will become as ‘Down’.

Down

6. Now you can click ‘Run’ button to start this VM.

Up