Skip to content

Commit 1be837a

Browse files
Srivastava, PiyushSrivastava, Piyush
authored andcommitted
vm instance creation test10
1 parent 8927471 commit 1be837a

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -137,27 +137,27 @@ private String createCloudStackVolumeForTypeVolume(DataStore dataStore, DataObje
137137
// CRITICAL: Set poolType at VOLUME level
138138
// This tells KVM to use LibvirtStorageAdaptor (NFS) instead of IscsiAdmStorageAdaptor
139139
volume.setPoolType(Storage.StoragePoolType.NetworkFilesystem);
140-
// Use unique volume name combining CloudStack volume name and UUID
141-
// This creates a unique filename directly in NFS root (flat structure)
140+
// Create unique volume name: name_uuid format for readability
141+
// Example: ROOT-22_e4cf5d79-3a5f-4618-b3c5-f727ff3d1603
142142
String volumeName = ((VolumeInfo) dataObject).getName();
143143
String volumeUuid = ((VolumeInfo) dataObject).getUuid();
144144
String uniqueVolumeName = volumeName + "_" + volumeUuid;
145-
// For managed NFS, set the volume name to the unique name
146-
// KVM will create qcow2 file directly in NFS root: /mnt/pool/ROOT-21_uuid.qcow2
147-
volume.setName(uniqueVolumeName);
145+
// Set path to the unique name so KVM can find it later
146+
// This is critical - the path is what KVM uses to locate the file
148147
volume.setPath(uniqueVolumeName);
149-
volume.setFolder(volumeUuid); // Store UUID for reference
148+
volume.setFolder(""); // No folder for flat structure
150149
volume.setPoolId(dataStore.getId());
151150
volumeDao.update(volume.getId(), volume);
152151
s_logger.info("=== ONTAP Managed NFS Volume (Flat Structure) ===");
153-
s_logger.info("Volume Name: {} (used by KVM for file creation)", uniqueVolumeName);
154-
s_logger.info("Volume Path: {}", volume.getPath());
152+
s_logger.info("Volume Name: {}", volumeName);
155153
s_logger.info("Volume UUID: {}", volumeUuid);
154+
s_logger.info("Volume Path: {} (name_uuid format)", uniqueVolumeName);
156155
s_logger.info("Volume PoolType: {}", volume.getPoolType());
157156
s_logger.info("Hypervisor will create: /mnt/<pool>/{}.qcow2", uniqueVolumeName);
158157
s_logger.info("================================================");
159-
// Return null - let hypervisor create the qcow2 file directly in NFS root
160-
return null;
158+
// CRITICAL: Return the unique name (not null!)
159+
// This tells CloudStack what path was created, so KVM can find it later
160+
return uniqueVolumeName;
161161
}
162162
// For iSCSI and other protocols, use ONTAP REST API
163163
StorageStrategy storageStrategy = getStrategyByStoragePoolDetails(details);

0 commit comments

Comments
 (0)