/** * <备份虚拟机> * * @return * @see [类、类#方法、类#成员] */ public String backupVM() { long beginRunTime = 0; if (logger.isDebugEnabled()) { beginRunTime = System.currentTimeMillis(); logger.debug("enter backupVM method."); } ControlPanelUser controlPanelUser = (ControlPanelUser) super.getSession().getAttribute(Constants.LOGIN_CURRENTUSER); if (controlPanelUser == null) { super.fillActionResult(Constants.OPTIONS_TIMEOUT); return null; } String vmId = controlPanelUser.getVmId(); String operateObject = "VM[vmId:" + vmId + "]"; String result = null; try { result = facade.backupVmByVmId( vmId, sn_name, sn_comments, sn_type, controlPanelUser, LogOperatorType.CP.getName()); facade.insertOperationLog( controlPanelUser, "发送备份虚拟机命令成功", "发送备份虚拟机命令", Constants.RESULT_SUCESS, operateObject); } catch (HsCloudException e) { facade.insertOperationLog( controlPanelUser, "发送备份虚拟机命令出现错误:" + e.getMessage(), "发送备份虚拟机命令", Constants.RESULT_FAILURE, operateObject); dealThrow( new HsCloudException(Constants.VM_BACKUP_ERROR, "createBackupVmPlan异常", logger, e), "000"); return null; } if (result != null) { super.fillActionResult(Constants.OPTIONS_SUCCESS); } else { super.fillActionResult(Constants.VM_BACKUP_ERROR); } if (null == result) { fillActionResult(Constants.VM_NO_ACTIVE); } if (logger.isDebugEnabled()) { long takeTime = System.currentTimeMillis() - beginRunTime; logger.debug("exit backupVM method.takeTime:" + takeTime + "ms"); } return null; }