Skip to content

Commit 223b272

Browse files
committed
CS-18685: do not modify vo, if you don't want to store it in db afterwards, as vo is cached by default.
1 parent 37f99d8 commit 223b272

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

‎server/src/com/cloud/storage/VolumeManagerImpl.java‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -651,11 +651,8 @@ public VolumeInfo createVolume(VolumeInfo volume, VMInstanceVO vm,
651651
DiskOfferingVO diskOffering, List<StoragePool> avoids,
652652
long size, HypervisorType hyperType) {
653653
StoragePool pool = null;
654-
DiskProfile dskCh = null;
655-
if (diskOffering != null && diskOffering.isCustomized()) {
656-
dskCh.setSize(size);
657-
}
658654

655+
DiskProfile dskCh = null;
659656
if (volume.getVolumeType() == Type.ROOT
660657
&& Storage.ImageFormat.ISO != template.getFormat()) {
661658
dskCh = createDiskCharacteristics(volume, template, dc, offering);
@@ -664,6 +661,10 @@ public VolumeInfo createVolume(VolumeInfo volume, VMInstanceVO vm,
664661
diskOffering);
665662
}
666663

664+
if (diskOffering != null && diskOffering.isCustomized()) {
665+
dskCh.setSize(size);
666+
}
667+
667668
dskCh.setHyperType(hyperType);
668669

669670
final HashSet<StoragePool> avoidPools = new HashSet<StoragePool>(

0 commit comments

Comments
 (0)