public abstract class VmCommand<T extends VmOperationParameterBase> extends CommandBase<T>
Modifier and Type | Field and Description |
---|---|
protected static int |
MAX_NETWORK_INTERFACES_SUPPORTED |
BYTES_IN_GB
Modifier | Constructor and Description |
---|---|
|
VmCommand() |
protected |
VmCommand(Guid commandId)
Constructor for command creation when compensation is applied on startup
|
|
VmCommand(T parameters) |
Modifier and Type | Method and Description |
---|---|
static boolean |
CheckPCIAndIDELimit(int monitorsNumber,
List<VmNetworkInterface> interfaces,
List<DiskImageBase> disks,
ArrayList<String> messages)
This method checks that with the given parameters, the max PCI and IDE limits defined are not passed.
|
protected Guid |
ConcreteCreateTask(AsyncTaskCreationInfo asyncTaskCreationInfo,
VdcActionType parentCommand) |
protected void |
EndActionOnDisks() |
protected void |
EndSuccessfully() |
protected void |
EndVmCommand() |
protected void |
EndWithFailure() |
protected void |
executeCommand() |
protected void |
ExecuteVmCommand() |
protected int |
getBlockSparseInitSizeInGB() |
protected VdcActionType |
getChildActionType() |
protected String |
getDescription() |
protected int |
getNeededDiskSize() |
Map<Guid,VdcObjectType> |
getPermissionCheckSubjects()
Permissions are attached to object so every command must declare its
object target type and its GUID
|
protected List<tags> |
GetTagsAttachedToObject() |
protected static void |
handleCustomPropertiesError(List<VmPropertiesUtils.ValidationError> validationErrors,
ArrayList<String> message) |
protected boolean |
HandleHibernatedVm(VdcActionType parentCommand,
boolean startPollingTasks) |
protected boolean |
isVmNameValidLength(VM vm)
Checks if VM name has valid length (check that it's too long).
|
protected void |
lockVmWithCompensationIfNeeded()
Lock the VM.
If the command is run internally then compensation won't be used, since it might cause a deadlock if the calling command has already updated the VM's row in the DB but hasn't committed before calling the child command. Otherwise, compensation will be used, and the VM will be locked in a new transaction, so that the lock gets reflected in the DB immediately. |
protected void |
RemoveVmDynamic() |
protected boolean |
RemoveVmInSpm(Guid storagePoolId,
Guid vmID) |
protected boolean |
RemoveVmInSpm(Guid storagePoolId,
Guid vmID,
Guid storageDomainId) |
protected void |
RemoveVmNetwork() |
protected void |
RemoveVmStatic() |
protected void |
RemoveVmStatistics() |
protected void |
RemoveVmUsers() |
static boolean |
UpdateVmInSpm(Guid storagePoolId,
List<VM> vmsList)
This method create OVF for each vm in list and call updateVm in SPM
|
static boolean |
UpdateVmInSpm(Guid storagePoolId,
List<VM> vmsList,
Guid storageDomainId) |
static boolean |
validateNumberOfNics(List<VmNetworkInterface> interfaces,
VmNetworkInterface networkInterface)
check that we number of Network-Interfaces does not exceed maximum (kvm limitation).
|
acquireLock, addCanDoActionMessage, addCanDoActionMessage, addValidationGroup, canDoAction, CanDoActionOnly, compensate, CreateReturnValue, CreateTask, EndAction, endActionInTransactionScope, ExecuteAction, freeLock, getActionReturnValue, getActionState, getActionType, getBusinessEntitySnapshotDAO, getCommandShouldBeLogged, getCompensationContext, getNow, getObjectLockingId, getParameters, getParametersForTask, getReturnValue, getSucceeded, getTaskIdList, getTransactionScopeOption, getTransactionTimeout, getValidationGroups, IsBackwardsCompatible, isInternalExecution, IsUserAutorizedToRunAction, RevertTasks, Rollback, runInTransaction, runVdsCommand, setActionMessageParameters, setActionReturnValue, setCommandShouldBeLogged, setCompensationContext, setDescription, setInternalExecution, setSucceeded, UpdateTasksWithActionParameters, validateInputs
AddCustomValue, AppendCustomValue, DefaultLog, getAuditLogTypeValue, getCurrentUser, GetCustomValue, getCustomValues, getKey, getSnapshotName, getStorageDomain, getStorageDomainDAO, getStorageDomainId, getStorageDomainName, getStoragePool, getStoragePoolDAO, getStoragePoolId, getStoragePoolName, getUserId, getUserName, getVds, getVdsDAO, getVdsGroup, getVdsGroupDAO, getVdsGroupId, getVdsGroupName, getVdsId, getVdsIdRef, getVdsName, getVm, getVmDAO, getVmId, getVmIdRef, getVmName, getVmStaticDAO, getVmStatisticsDAO, getVmTemplate, getVmTemplateDAO, getVmTemplateId, getVmTemplateIdRef, getVmTemplateName, log, setCurrentUser, setSnapshotName, setStorageDomain, setStorageDomainId, setStoragePool, setStoragePoolId, setUserId, setUserName, setVds, setVdsGroup, setVdsGroupId, setVdsId, setVdsIdRef, setVdsName, setVm, setVmId, setVmName, setVmTemplate, setVmTemplateId, setVmTemplateName
getEndTime, getLegal, getTimeoutObjectId, getUseTimout, setEndTime, setTimeoutObjectId, setUseTimout
protected static final int MAX_NETWORK_INTERFACES_SUPPORTED
public VmCommand(T parameters)
protected VmCommand(Guid commandId)
commandId
- public VmCommand()
protected void executeCommand()
executeCommand
in class CommandBase<T extends VmOperationParameterBase>
protected void ExecuteVmCommand()
protected String getDescription()
getDescription
in class CommandBase<T extends VmOperationParameterBase>
protected List<tags> GetTagsAttachedToObject()
GetTagsAttachedToObject
in class CommandBase<T extends VmOperationParameterBase>
public static boolean CheckPCIAndIDELimit(int monitorsNumber, List<VmNetworkInterface> interfaces, List<DiskImageBase> disks, ArrayList<String> messages)
monitorsNumber
- interfaces
- disks
- public static boolean UpdateVmInSpm(Guid storagePoolId, List<VM> vmsList)
storagePoolId
- vmsList
- public static boolean UpdateVmInSpm(Guid storagePoolId, List<VM> vmsList, Guid storageDomainId)
protected void RemoveVmStatic()
protected void RemoveVmNetwork()
protected void RemoveVmDynamic()
protected void RemoveVmStatistics()
protected void RemoveVmUsers()
protected void EndVmCommand()
protected void EndActionOnDisks()
protected void EndSuccessfully()
EndSuccessfully
in class CommandBase<T extends VmOperationParameterBase>
protected void EndWithFailure()
EndWithFailure
in class CommandBase<T extends VmOperationParameterBase>
protected VdcActionType getChildActionType()
protected boolean HandleHibernatedVm(VdcActionType parentCommand, boolean startPollingTasks)
protected Guid ConcreteCreateTask(AsyncTaskCreationInfo asyncTaskCreationInfo, VdcActionType parentCommand)
ConcreteCreateTask
in class CommandBase<T extends VmOperationParameterBase>
public Map<Guid,VdcObjectType> getPermissionCheckSubjects()
CommandBase
getPermissionCheckSubjects
in class CommandBase<T extends VmOperationParameterBase>
protected int getNeededDiskSize()
protected int getBlockSparseInitSizeInGB()
protected static void handleCustomPropertiesError(List<VmPropertiesUtils.ValidationError> validationErrors, ArrayList<String> message)
protected boolean isVmNameValidLength(VM vm)
vm
- the VM to checkprotected void lockVmWithCompensationIfNeeded()
public static boolean validateNumberOfNics(List<VmNetworkInterface> interfaces, VmNetworkInterface networkInterface)
interfaces
- Copyright © 2012. All Rights Reserved.