mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-16 10:32:34 +01:00
CLOUDSTACK-8312: The storage usage of "Primary Storage Allocated" is incorrect.
(cherry picked from commit 520d96724ac437aa0a9ed391066f4f0879eaef7e) Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
parent
290938b08e
commit
5aedeb74f9
@ -190,6 +190,7 @@ public class TemplateObject implements TemplateInfo {
|
||||
TemplateObjectTO newTemplate = (TemplateObjectTO)cpyAnswer.getNewData();
|
||||
VMTemplateStoragePoolVO templatePoolRef = templatePoolDao.findByPoolTemplate(getDataStore().getId(), getId());
|
||||
templatePoolRef.setDownloadPercent(100);
|
||||
templatePoolRef.setTemplateSize(newTemplate.getSize());
|
||||
templatePoolRef.setDownloadState(Status.DOWNLOADED);
|
||||
templatePoolRef.setLocalDownloadPath(newTemplate.getPath());
|
||||
templatePoolRef.setInstallPath(newTemplate.getPath());
|
||||
|
||||
@ -219,6 +219,7 @@ public class KVMStorageProcessor implements StorageProcessor {
|
||||
if (destData.getObjectType() == DataObjectType.TEMPLATE) {
|
||||
TemplateObjectTO newTemplate = new TemplateObjectTO();
|
||||
newTemplate.setPath(primaryVol.getName());
|
||||
newTemplate.setSize(primaryVol.getSize());
|
||||
if (primaryPool.getType() == StoragePoolType.RBD) {
|
||||
newTemplate.setFormat(ImageFormat.RAW);
|
||||
} else {
|
||||
@ -228,6 +229,7 @@ public class KVMStorageProcessor implements StorageProcessor {
|
||||
} else if (destData.getObjectType() == DataObjectType.VOLUME) {
|
||||
VolumeObjectTO volumeObjectTO = new VolumeObjectTO();
|
||||
volumeObjectTO.setPath(primaryVol.getName());
|
||||
volumeObjectTO.setSize(primaryVol.getSize());
|
||||
if (primaryVol.getFormat() == PhysicalDiskFormat.RAW)
|
||||
volumeObjectTO.setFormat(ImageFormat.RAW);
|
||||
else if (primaryVol.getFormat() == PhysicalDiskFormat.QCOW2) {
|
||||
|
||||
@ -816,6 +816,7 @@ public class XenServerStorageProcessor implements StorageProcessor {
|
||||
VDI tmplVdi = getVDIbyUuid(conn, tmplUuid);
|
||||
|
||||
final String uuidToReturn;
|
||||
Long physicalSize = tmplVdi.getPhysicalUtilisation(conn);
|
||||
|
||||
if (managed) {
|
||||
uuidToReturn = tmplUuid;
|
||||
@ -842,6 +843,7 @@ public class XenServerStorageProcessor implements StorageProcessor {
|
||||
|
||||
newVol.setUuid(uuidToReturn);
|
||||
newVol.setPath(uuidToReturn);
|
||||
newVol.setSize(physicalSize);
|
||||
newVol.setFormat(ImageFormat.VHD);
|
||||
|
||||
return new CopyCmdAnswer(newVol);
|
||||
|
||||
@ -236,6 +236,7 @@ public class Xenserver625StorageProcessor extends XenServerStorageProcessor {
|
||||
VDI tmplVdi = Types.toVDI(task, conn);
|
||||
|
||||
final String uuidToReturn;
|
||||
Long physicalSize = tmplVdi.getPhysicalUtilisation(conn);
|
||||
|
||||
if (managed) {
|
||||
uuidToReturn = tmplVdi.getUuid(conn);
|
||||
@ -262,6 +263,7 @@ public class Xenserver625StorageProcessor extends XenServerStorageProcessor {
|
||||
|
||||
newVol.setUuid(uuidToReturn);
|
||||
newVol.setPath(uuidToReturn);
|
||||
newVol.setSize(physicalSize);
|
||||
newVol.setFormat(Storage.ImageFormat.VHD);
|
||||
|
||||
return new CopyCmdAnswer(newVol);
|
||||
|
||||
@ -576,11 +576,6 @@ public class CapacityManagerImpl extends ManagerBase implements CapacityManager,
|
||||
totalAllocatedSize += templateSize + _extraBytesPerVolume;
|
||||
}
|
||||
|
||||
// Add the size for the templateForVmCreation if its not already present
|
||||
/*if ((templateForVmCreation != null) && !tmpinstalled) {
|
||||
|
||||
}*/
|
||||
|
||||
return totalAllocatedSize;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user