mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CLOUDSTACK-8312: The storage usage of "Primary Storage Allocated" is incorrect.
This commit is contained in:
parent
1fd401ff43
commit
520d96724a
@ -190,6 +190,7 @@ public class TemplateObject implements TemplateInfo {
|
|||||||
TemplateObjectTO newTemplate = (TemplateObjectTO)cpyAnswer.getNewData();
|
TemplateObjectTO newTemplate = (TemplateObjectTO)cpyAnswer.getNewData();
|
||||||
VMTemplateStoragePoolVO templatePoolRef = templatePoolDao.findByPoolTemplate(getDataStore().getId(), getId());
|
VMTemplateStoragePoolVO templatePoolRef = templatePoolDao.findByPoolTemplate(getDataStore().getId(), getId());
|
||||||
templatePoolRef.setDownloadPercent(100);
|
templatePoolRef.setDownloadPercent(100);
|
||||||
|
templatePoolRef.setTemplateSize(newTemplate.getSize());
|
||||||
templatePoolRef.setDownloadState(Status.DOWNLOADED);
|
templatePoolRef.setDownloadState(Status.DOWNLOADED);
|
||||||
templatePoolRef.setLocalDownloadPath(newTemplate.getPath());
|
templatePoolRef.setLocalDownloadPath(newTemplate.getPath());
|
||||||
templatePoolRef.setInstallPath(newTemplate.getPath());
|
templatePoolRef.setInstallPath(newTemplate.getPath());
|
||||||
|
|||||||
@ -228,6 +228,7 @@ public class KVMStorageProcessor implements StorageProcessor {
|
|||||||
if (destData.getObjectType() == DataObjectType.TEMPLATE) {
|
if (destData.getObjectType() == DataObjectType.TEMPLATE) {
|
||||||
TemplateObjectTO newTemplate = new TemplateObjectTO();
|
TemplateObjectTO newTemplate = new TemplateObjectTO();
|
||||||
newTemplate.setPath(primaryVol.getName());
|
newTemplate.setPath(primaryVol.getName());
|
||||||
|
newTemplate.setSize(primaryVol.getSize());
|
||||||
if (primaryPool.getType() == StoragePoolType.RBD) {
|
if (primaryPool.getType() == StoragePoolType.RBD) {
|
||||||
newTemplate.setFormat(ImageFormat.RAW);
|
newTemplate.setFormat(ImageFormat.RAW);
|
||||||
} else {
|
} else {
|
||||||
@ -237,6 +238,7 @@ public class KVMStorageProcessor implements StorageProcessor {
|
|||||||
} else if (destData.getObjectType() == DataObjectType.VOLUME) {
|
} else if (destData.getObjectType() == DataObjectType.VOLUME) {
|
||||||
VolumeObjectTO volumeObjectTO = new VolumeObjectTO();
|
VolumeObjectTO volumeObjectTO = new VolumeObjectTO();
|
||||||
volumeObjectTO.setPath(primaryVol.getName());
|
volumeObjectTO.setPath(primaryVol.getName());
|
||||||
|
volumeObjectTO.setSize(primaryVol.getSize());
|
||||||
if (primaryVol.getFormat() == PhysicalDiskFormat.RAW)
|
if (primaryVol.getFormat() == PhysicalDiskFormat.RAW)
|
||||||
volumeObjectTO.setFormat(ImageFormat.RAW);
|
volumeObjectTO.setFormat(ImageFormat.RAW);
|
||||||
else if (primaryVol.getFormat() == PhysicalDiskFormat.QCOW2) {
|
else if (primaryVol.getFormat() == PhysicalDiskFormat.QCOW2) {
|
||||||
|
|||||||
@ -850,6 +850,7 @@ public class XenServerStorageProcessor implements StorageProcessor {
|
|||||||
VDI tmplVdi = getVDIbyUuid(conn, tmplUuid);
|
VDI tmplVdi = getVDIbyUuid(conn, tmplUuid);
|
||||||
|
|
||||||
final String uuidToReturn;
|
final String uuidToReturn;
|
||||||
|
Long physicalSize = tmplVdi.getPhysicalUtilisation(conn);
|
||||||
|
|
||||||
if (managed) {
|
if (managed) {
|
||||||
uuidToReturn = tmplUuid;
|
uuidToReturn = tmplUuid;
|
||||||
@ -876,6 +877,7 @@ public class XenServerStorageProcessor implements StorageProcessor {
|
|||||||
|
|
||||||
newVol.setUuid(uuidToReturn);
|
newVol.setUuid(uuidToReturn);
|
||||||
newVol.setPath(uuidToReturn);
|
newVol.setPath(uuidToReturn);
|
||||||
|
newVol.setSize(physicalSize);
|
||||||
newVol.setFormat(ImageFormat.VHD);
|
newVol.setFormat(ImageFormat.VHD);
|
||||||
|
|
||||||
return new CopyCmdAnswer(newVol);
|
return new CopyCmdAnswer(newVol);
|
||||||
|
|||||||
@ -265,6 +265,7 @@ public class Xenserver625StorageProcessor extends XenServerStorageProcessor {
|
|||||||
VDI tmplVdi = Types.toVDI(task, conn);
|
VDI tmplVdi = Types.toVDI(task, conn);
|
||||||
|
|
||||||
final String uuidToReturn;
|
final String uuidToReturn;
|
||||||
|
Long physicalSize = tmplVdi.getPhysicalUtilisation(conn);
|
||||||
|
|
||||||
if (managed) {
|
if (managed) {
|
||||||
uuidToReturn = tmplVdi.getUuid(conn);
|
uuidToReturn = tmplVdi.getUuid(conn);
|
||||||
@ -291,6 +292,7 @@ public class Xenserver625StorageProcessor extends XenServerStorageProcessor {
|
|||||||
|
|
||||||
newVol.setUuid(uuidToReturn);
|
newVol.setUuid(uuidToReturn);
|
||||||
newVol.setPath(uuidToReturn);
|
newVol.setPath(uuidToReturn);
|
||||||
|
newVol.setSize(physicalSize);
|
||||||
newVol.setFormat(Storage.ImageFormat.VHD);
|
newVol.setFormat(Storage.ImageFormat.VHD);
|
||||||
|
|
||||||
return new CopyCmdAnswer(newVol);
|
return new CopyCmdAnswer(newVol);
|
||||||
|
|||||||
@ -573,11 +573,6 @@ public class CapacityManagerImpl extends ManagerBase implements CapacityManager,
|
|||||||
totalAllocatedSize += templateSize + _extraBytesPerVolume;
|
totalAllocatedSize += templateSize + _extraBytesPerVolume;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add the size for the templateForVmCreation if its not already present
|
|
||||||
/*if ((templateForVmCreation != null) && !tmpinstalled) {
|
|
||||||
|
|
||||||
}*/
|
|
||||||
|
|
||||||
return totalAllocatedSize;
|
return totalAllocatedSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user