In Apache CloudStack it is possible for the database to become out of sync with what is actually happening. For instance if there is a network issue preventing CloudStack from correctly connecting to the hypervisor or virtual machine and you try to shutdown or reboot a server, the action may not actually take place despite the state in the CloudStack database being modified.
This can cause the instance to show as being in the ‘starting’ or ‘stopping’ states for instance, however the virtual machine may already be fully booted or completely powered off. To fix this we can manually update the management database to the correct state.