@@ -2024,20 +2024,20 @@ private Volume orchestrateAttachVolumeToVM(Long vmId, Long volumeId, Long device
20242024 }
20252025
20262026 UserVmVO vm = _userVmDao .findById (vmId );
2027- VolumeVO exstingVolumeOfVm = null ;
2027+ VolumeVO existingVolumeOfVm = null ;
20282028 VMTemplateVO template = _templateDao .findById (vm .getTemplateId ());
20292029 List <VolumeVO > rootVolumesOfVm = _volsDao .findByInstanceAndType (vmId , Volume .Type .ROOT );
20302030 if (rootVolumesOfVm .size () > 1 && template != null && !template .isDeployAsIs ()) {
20312031 throw new CloudRuntimeException ("The VM " + vm .getHostName () + " has more than one ROOT volume and is in an invalid state." );
20322032 } else {
20332033 if (!rootVolumesOfVm .isEmpty ()) {
2034- exstingVolumeOfVm = rootVolumesOfVm .get (0 );
2034+ existingVolumeOfVm = rootVolumesOfVm .get (0 );
20352035 } else {
20362036 // locate data volume of the vm
20372037 List <VolumeVO > diskVolumesOfVm = _volsDao .findByInstanceAndType (vmId , Volume .Type .DATADISK );
20382038 for (VolumeVO diskVolume : diskVolumesOfVm ) {
20392039 if (diskVolume .getState () != Volume .State .Allocated ) {
2040- exstingVolumeOfVm = diskVolume ;
2040+ existingVolumeOfVm = diskVolume ;
20412041 break ;
20422042 }
20432043 }
@@ -2051,8 +2051,8 @@ private Volume orchestrateAttachVolumeToVM(Long vmId, Long volumeId, Long device
20512051
20522052 //don't create volume on primary storage if its being attached to the vm which Root's volume hasn't been created yet
20532053 StoragePoolVO destPrimaryStorage = null ;
2054- if (exstingVolumeOfVm != null && !exstingVolumeOfVm .getState ().equals (Volume .State .Allocated )) {
2055- destPrimaryStorage = _storagePoolDao .findById (exstingVolumeOfVm .getPoolId ());
2054+ if (existingVolumeOfVm != null && !existingVolumeOfVm .getState ().equals (Volume .State .Allocated )) {
2055+ destPrimaryStorage = _storagePoolDao .findById (existingVolumeOfVm .getPoolId ());
20562056 }
20572057
20582058 boolean volumeOnSecondary = volumeToAttach .getState () == Volume .State .Uploaded ;
@@ -2071,15 +2071,15 @@ private Volume orchestrateAttachVolumeToVM(Long vmId, Long volumeId, Long device
20712071
20722072 // reload the volume from db
20732073 newVolumeOnPrimaryStorage = volFactory .getVolume (newVolumeOnPrimaryStorage .getId ());
2074- boolean moveVolumeNeeded = needMoveVolume (exstingVolumeOfVm , newVolumeOnPrimaryStorage );
2074+ boolean moveVolumeNeeded = needMoveVolume (existingVolumeOfVm , newVolumeOnPrimaryStorage );
20752075
20762076 if (moveVolumeNeeded ) {
20772077 PrimaryDataStoreInfo primaryStore = (PrimaryDataStoreInfo )newVolumeOnPrimaryStorage .getDataStore ();
20782078 if (primaryStore .isLocal ()) {
20792079 throw new CloudRuntimeException (
20802080 "Failed to attach local data volume " + volumeToAttach .getName () + " to VM " + vm .getDisplayName () + " as migration of local data volume is not allowed" );
20812081 }
2082- StoragePoolVO vmRootVolumePool = _storagePoolDao .findById (exstingVolumeOfVm .getPoolId ());
2082+ StoragePoolVO vmRootVolumePool = _storagePoolDao .findById (existingVolumeOfVm .getPoolId ());
20832083
20842084 try {
20852085 newVolumeOnPrimaryStorage = _volumeMgr .moveVolume (newVolumeOnPrimaryStorage , vmRootVolumePool .getDataCenterId (), vmRootVolumePool .getPodId (), vmRootVolumePool .getClusterId (),
0 commit comments