CLOUDSTACK-6257: Adding function to check state of VM