If an operation that implies a state change on a VM fails, sometimes RHEV sets the VM status to ‘Unknown’.
This morning, after a fail of a ‘Power off’ operation on a VM in panic – due to a bug ([vdsm] AttributeError: GuestAgent instance has no attribute ‘_sock’) – the VM state was set to ‘Unknown’.
In this case basically you don’t can do anything…
If you know the real state of your VM, you can manually change it and restart the VM. So I set the state of my VM to 0 (stopped) and I restarted it.
[root@rhevm ~]# psql -U engine psql (8.4.20) Digita "help" per avere un aiuto. engine=> select vm_guid from vm_static where vm_name='server.example.com'; vm_guid -------------------------------------- 2d1e72a1-16c4-4f38-a21e-78113669dd98 (1 riga) engine=> select status from vm_dynamic where vm_guid='2d1e72a1-16c4-4f38-a21e-78113669dd98'; status -------- 7 (1 riga) engine=> update vm_dynamic set status=0 where vm_guid='2d1e72a1-16c4-4f38-a21e-78113669dd98'; UPDATE 1
[oVirt shell (connected)]# action vm server.example.com start job-id : 7f1ac179-047c-4d50-932f-3ae7970c96e2 status-state: complete vm-id : 2d1e72a1-16c4-4f38-a21e-78113669dd98
You have specified that the procedure applies only “If you know the real state of your VM”, so the question is how do we know the state of the VM?
I will wait for an article with the answer ;-)