Skip to content

Commit 7aee165

Browse files
Srivastava, PiyushSrivastava, Piyush
authored andcommitted
vm instance creation test7
1 parent 9f615f3 commit 7aee165

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/driver/OntapPrimaryDatastoreDriver.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -293,14 +293,13 @@ private String createManagedNfsVolume(DataStore dataStore, DataObject dataObject
293293
String junctionPath = storagePool.getPath();
294294

295295
// Update volume metadata in CloudStack database
296-
volume.setPoolType(Storage.StoragePoolType.ManagedNFS);
296+
// Use NetworkFilesystem (not ManagedNFS) - matches pool type set during pool creation
297+
volume.setPoolType(Storage.StoragePoolType.NetworkFilesystem);
297298
volume.setPoolId(dataStore.getId());
298299
volume.setPath(volumeUuid); // Filename for qcow2 file
299300

300-
// CRITICAL: For ManagedNFS, _iScsiName must be the volume UUID, NOT the junction path
301-
// CloudStack uses _iScsiName as MANAGED_STORE_TARGET -> volPath -> libvirt pool name
302-
// Libvirt pool names cannot contain '/', so we use the UUID
303-
// The junction path comes from storage_pool_details.mountpoint (set in getStoreTO)
301+
// For NetworkFilesystem with managed=true, _iScsiName should be set to volume UUID
302+
// This maintains compatibility with managed storage behavior
304303
volume.set_iScsiName(volumeUuid);
305304

306305
volumeDao.update(volume.getId(), volume);

plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/lifecycle/OntapPrimaryDatastoreLifecycle.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,10 @@ public DataStore initialize(Map<String, Object> dsInfos) {
192192
ProtocolType protocol = ProtocolType.valueOf(details.get(Constants.PROTOCOL));
193193
switch (protocol) {
194194
case NFS:
195-
parameters.setType(Storage.StoragePoolType.ManagedNFS);
195+
// Use NetworkFilesystem (not ManagedNFS) with managed=true
196+
// This routes to LibvirtStorageAdaptor which has full qemu-img support
197+
// Same pattern as CloudByte/Elastistor plugin
198+
parameters.setType(Storage.StoragePoolType.NetworkFilesystem);
196199
// Path should be just the NFS export path (junction path), NOT host:path
197200
// CloudStack will construct the full mount path as: hostAddress + ":" + path
198201
path = "/" + storagePoolName;

0 commit comments

Comments
 (0)