Updated Branches: refs/heads/4.3 1b064515a -> 413c61b51
CLOUDSTACK-5873: [Automation] Failed to attach volume to VM, if the vm is created with option startvm=false Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/413c61b5 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/413c61b5 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/413c61b5 Branch: refs/heads/4.3 Commit: 413c61b5192c3e409129f47493b0d0cdcf3fe0d1 Parents: 1b06451 Author: Mike Tutkowski <[email protected]> Authored: Sun Jan 19 09:03:17 2014 -0700 Committer: Mike Tutkowski <[email protected]> Committed: Mon Jan 20 23:08:27 2014 -0700 ---------------------------------------------------------------------- .../datastore/driver/SolidfirePrimaryDataStoreDriver.java | 7 +++++++ server/src/com/cloud/storage/VolumeApiServiceImpl.java | 7 ++----- 2 files changed, 9 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/413c61b5/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/driver/SolidfirePrimaryDataStoreDriver.java ---------------------------------------------------------------------- diff --git a/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/driver/SolidfirePrimaryDataStoreDriver.java b/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/driver/SolidfirePrimaryDataStoreDriver.java index 0bf9c50..e69534b 100644 --- a/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/driver/SolidfirePrimaryDataStoreDriver.java +++ b/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/driver/SolidfirePrimaryDataStoreDriver.java @@ -212,6 +212,12 @@ public class SolidfirePrimaryDataStoreDriver implements PrimaryDataStoreDriver { @Override public ChapInfo getChapInfo(VolumeInfo volumeInfo) { + return null; + } + + /* + @Override + public ChapInfo getChapInfo(VolumeInfo volumeInfo) { long accountId = volumeInfo.getAccountId(); AccountDetailVO accountDetail = _accountDetailsDao.findDetail(accountId, SolidFireUtil.CHAP_INITIATOR_USERNAME); @@ -232,6 +238,7 @@ public class SolidfirePrimaryDataStoreDriver implements PrimaryDataStoreDriver { return new ChapInfoImpl(chapInitiatorUsername, chapInitiatorSecret, chapTargetUsername, chapTargetSecret); } + */ // get the VAG associated with volumeInfo's cluster, if any (ListVolumeAccessGroups) // if the VAG exists http://git-wip-us.apache.org/repos/asf/cloudstack/blob/413c61b5/server/src/com/cloud/storage/VolumeApiServiceImpl.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/storage/VolumeApiServiceImpl.java b/server/src/com/cloud/storage/VolumeApiServiceImpl.java index 337aea1..f46f1e9 100644 --- a/server/src/com/cloud/storage/VolumeApiServiceImpl.java +++ b/server/src/com/cloud/storage/VolumeApiServiceImpl.java @@ -2023,13 +2023,10 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic // volumeToAttachStoragePool should be null if the VM we are attaching the disk to has never been started before DataStore dataStore = volumeToAttachStoragePool != null ? dataStoreMgr.getDataStore(volumeToAttachStoragePool.getId(), DataStoreRole.Primary) : null; - boolean queryForChap = true; - // if we don't have a host, the VM we are attaching the disk to has never been started before if (host != null) { try { - // if connectVolumeToHost returns true, then we do not want to use CHAP because the volume is already connected to the host(s) - queryForChap = !volService.connectVolumeToHost(volFactory.getVolume(volumeToAttach.getId()), host, dataStore); + volService.connectVolumeToHost(volFactory.getVolume(volumeToAttach.getId()), host, dataStore); } catch (Exception e) { volService.disconnectVolumeFromHost(volFactory.getVolume(volumeToAttach.getId()), host, dataStore); @@ -2052,7 +2049,7 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic AttachCommand cmd = new AttachCommand(disk, vm.getInstanceName()); - ChapInfo chapInfo = queryForChap ? volService.getChapInfo(volFactory.getVolume(volumeToAttach.getId()), dataStore) : null; + ChapInfo chapInfo = volService.getChapInfo(volFactory.getVolume(volumeToAttach.getId()), dataStore); Map<String, String> details = new HashMap<String, String>();
