@Override
  protected void executeVmCommand() {
    if (getVm().getStatus().isUpOrPaused()) {
      updateDisksFromDb();
      performPlugCommand(getPlugAction(), getDisk(), oldVmDevice);
    }

    // At this point disk is already plugged to or unplugged from VM (depends on the command),
    // so we can update the needed device properties
    updateDeviceProperties();

    // Now after updating 'isPlugged' property of the plugged/unplugged device, its time to
    // update the boot order for all VM devices. Failure to do that doesn't change the fact that
    // device is already plugged to or unplugged from VM.
    if (disk.isBoot()) {
      updateBootOrder();
    }

    getVmStaticDao().incrementDbGeneration(getVm().getId());
    setSucceeded(true);
  }