bug CS-15119: check previously named datastore before we mount new one to support backwards compatibility

Reviewed-by:Anthony
This commit is contained in:
Kelven Yang 2012-05-30 10:35:52 -07:00
parent 9298e5d25d
commit 874544fd64

View File

@ -2341,8 +2341,11 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
throw new Exception("Unsupported storage pool type " + pool.getType());
}
ManagedObjectReference morDatastore = hyperHost.mountDatastore(pool.getType() == StoragePoolType.VMFS, pool.getHost(),
pool.getPort(), pool.getPath(), pool.getUuid().replace("-", ""));
ManagedObjectReference morDatastore = null;
morDatastore = HypervisorHostHelper.findDatastoreWithBackwardsCompatibility(hyperHost, pool.getUuid());
if(morDatastore == null)
morDatastore = hyperHost.mountDatastore(pool.getType() == StoragePoolType.VMFS, pool.getHost(),
pool.getPort(), pool.getPath(), pool.getUuid().replace("-", ""));
assert (morDatastore != null);
DatastoreSummary summary = new DatastoreMO(getServiceContext(), morDatastore).getSummary();