Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 1.4k
vmware: improve solidfire storage plugin integration and fix cases#7761
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Uh oh!
There was an error while loading. Please reload this page.
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4 ...stration/src/main/java/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1906,8 +1906,8 @@ public void prepare(VirtualMachineProfile vm, DeployDestination dest) throws Sto | ||
| throw new StorageAccessException(String.format("Unable to grant access to volume [%s] on host [%s].", volToString, host)); | ||
| } | ||
| } else { | ||
| // This might impact other managed storages, grant access for PowerFlex storage pool only | ||
| if (pool.getPoolType() == Storage.StoragePoolType.PowerFlex) { | ||
| // This might impact other managed storages, grant access for PowerFlex and Iscsi/Solidfire storage pool only | ||
| if (pool.getPoolType() == Storage.StoragePoolType.PowerFlex || pool.getPoolType() == Storage.StoragePoolType.Iscsi) { | ||
yadvr marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| try { | ||
| volService.grantAccess(volFactory.getVolume(vol.getId()), host, (DataStore)pool); | ||
| } catch (Exception e) { | ||
30 changes: 19 additions & 11 deletions
30 ...rs/vmware/src/main/java/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5 ...hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 10 additions & 2 deletions
12 ...s/hypervisors/vmware/src/main/java/com/cloud/storage/resource/VmwareStorageProcessor.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -2825,7 +2825,15 @@ private ManagedObjectReference getVmfsDatastore(VmwareContext context, VmwareHyp | ||
| morDs = firstHostDatastoreSystemMO.findDatastoreByName(datastoreName); | ||
| if (morDs == null) { | ||
| morDs = firstHostDatastoreSystemMO.createVmfsDatastore(datastoreName, hostScsiDisk); | ||
| final String hostVersion = firstHostMO.getProductVersion(); | ||
| if (hostVersion.compareTo(VmwareHelper.MIN_VERSION_VMFS6) >= 0) { | ||
| morDs = firstHostDatastoreSystemMO.createVmfs6Datastore(datastoreName, hostScsiDisk); | ||
| } else { | ||
| morDs = firstHostDatastoreSystemMO.createVmfs5Datastore(datastoreName, hostScsiDisk); | ||
| } | ||
| } else { | ||
| // in case of iSCSI/solidfire 1:1 VMFS datastore could be inaccessible | ||
| mountVmfsDatastore(new DatastoreMO(context, morDs), lstHosts); | ||
yadvr marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| } | ||
| if (morDs != null) { | ||
| @@ -3364,7 +3372,7 @@ private void addRemoveInternetScsiTargetsToAllHosts(boolean add, List<HostIntern | ||
| } | ||
| } | ||
| private void rescanAllHosts(VmwareContext context, List<Pair<ManagedObjectReference, String>> lstHostPairs, boolean rescanHba, boolean rescanVmfs) throws Exception { | ||
| public void rescanAllHosts(VmwareContext context, List<Pair<ManagedObjectReference, String>> lstHostPairs, boolean rescanHba, boolean rescanVmfs) throws Exception { | ||
| List<HostMO> hosts = new ArrayList<>(lstHostPairs.size()); | ||
| for (Pair<ManagedObjectReference, String> hostPair : lstHostPairs) { | ||
11 changes: 11 additions & 0 deletions
11 ...mware/src/test/java/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImplTest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 28 additions & 2 deletions
30 .../java/org/apache/cloudstack/storage/datastore/driver/SolidFirePrimaryDataStoreDriver.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -17,6 +17,7 @@ | ||
| package org.apache.cloudstack.storage.datastore.driver; | ||
| import java.text.NumberFormat; | ||
| import java.util.Arrays; | ||
| import java.util.ArrayList; | ||
| import java.util.HashMap; | ||
| import java.util.List; | ||
| @@ -85,6 +86,8 @@ | ||
| import com.cloud.utils.Pair; | ||
| import com.cloud.utils.db.GlobalLock; | ||
| import com.cloud.utils.exception.CloudRuntimeException; | ||
| import com.cloud.vm.dao.VMInstanceDao; | ||
| import com.cloud.vm.VirtualMachine; | ||
| import com.google.common.base.Preconditions; | ||
| public class SolidFirePrimaryDataStoreDriver implements PrimaryDataStoreDriver { | ||
| @@ -111,6 +114,7 @@ public class SolidFirePrimaryDataStoreDriver implements PrimaryDataStoreDriver { | ||
| @Inject private PrimaryDataStoreDao storagePoolDao; | ||
| @Inject private StoragePoolDetailsDao storagePoolDetailsDao; | ||
| @Inject private VMTemplatePoolDao vmTemplatePoolDao; | ||
| @Inject private VMInstanceDao vmDao; | ||
| @Inject private VolumeDao volumeDao; | ||
| @Inject private VolumeDetailsDao volumeDetailsDao; | ||
| @Inject private VolumeDataFactory volumeFactory; | ||
| @@ -187,13 +191,33 @@ public boolean grantAccess(DataObject dataObject, Host host, DataStore dataStore | ||
| } | ||
| } | ||
| private boolean isRevokeAccessNotNeeded(DataObject dataObject) { | ||
| // Workaround: don't unplug iscsi lun when volume is attached to a VM | ||
| // This is regression workaround from upper layers which are calling | ||
| // a releaseVmResources() method that calls the revoke on an attached disk | ||
| if (dataObject.getType() == DataObjectType.VOLUME) { | ||
yadvr marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| Volume volume = volumeDao.findById(dataObject.getId()); | ||
| if (volume.getInstanceId() != null) { | ||
| VirtualMachine vm = vmDao.findById(volume.getInstanceId()); | ||
| if (vm != null && !Arrays.asList(VirtualMachine.State.Destroyed, VirtualMachine.State.Expunging, VirtualMachine.State.Error).contains(vm.getState())) { | ||
| return true; | ||
| } | ||
| } | ||
| } | ||
| return false; | ||
| } | ||
| @Override | ||
| public void revokeAccess(DataObject dataObject, Host host, DataStore dataStore) | ||
| { | ||
| public void revokeAccess(DataObject dataObject, Host host, DataStore dataStore) { | ||
| if (dataObject == null || host == null || dataStore == null) { | ||
| return; | ||
| } | ||
| if (isRevokeAccessNotNeeded(dataObject)) { | ||
| LOGGER.debug("Skipping revoke access for Solidfire data object type:" + dataObject.getType() + " id:" + dataObject.getId()); | ||
| return; | ||
| } | ||
| long sfVolumeId = getSolidFireVolumeId(dataObject, false); | ||
| long clusterId = host.getClusterId(); | ||
| long storagePoolId = dataStore.getId(); | ||
| @@ -210,6 +234,8 @@ public void revokeAccess(DataObject dataObject, Host host, DataStore dataStore) | ||
| throw new CloudRuntimeException(errMsg); | ||
| } | ||
| LOGGER.debug("Revoking access for Solidfire data object type:" + dataObject.getType() + " id:" + dataObject.getId()); | ||
| try { | ||
| SolidFireUtil.SolidFireConnection sfConnection = SolidFireUtil.getSolidFireConnection(storagePoolId, storagePoolDetailsDao); | ||
17 changes: 10 additions & 7 deletions
17 vmware-base/src/main/java/com/cloud/hypervisor/vmware/mo/HostDatastoreSystemMO.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1 vmware-base/src/main/java/com/cloud/hypervisor/vmware/util/VmwareHelper.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.