@Override
	public VirtualMachineStatus status(VirtualMachine virtualMachine)
			throws Exception {

		boolean vmExists = checkWhetherMachineExists(virtualMachine);

		if (!vmExists) {
			return VirtualMachineStatus.NOT_CREATED;
		}

		ProcessBuilder statusProcess = getVMProcessBuilder(virtualMachine,
				"status");
		ExecutionResult statusInfo = HypervisorUtils.runProcess(statusProcess);

		if (statusInfo.getReturnValue() != ExecutionResult.OK) {
			if (statusInfo.getReturnValue() != VSERVER_STOPPED_EXIT_VALUE) {
				throw new Exception(statusInfo.getStdErr().toString());
			}
		}

		String status = statusInfo.getStdOut().get(0);
		if (status.contains("running")) {
			return VirtualMachineStatus.RUNNING;
		} else if (status.contains("stopped")) {
			return VirtualMachineStatus.POWERED_OFF;
		}
		return VirtualMachineStatus.NOT_REGISTERED;
	}