diff --git a/pkg/compute/models/storages.go b/pkg/compute/models/storages.go index 4ceff046d1..9e202e1726 100644 --- a/pkg/compute/models/storages.go +++ b/pkg/compute/models/storages.go @@ -635,7 +635,9 @@ func (self *SStorage) syncWithCloudStorage(ctx context.Context, userCred mcclien self.Status = extStorage.GetStatus() self.StorageType = extStorage.GetStorageType() self.MediumType = extStorage.GetMediumType() - self.Capacity = extStorage.GetCapacityMB() + if capacity := extStorage.GetCapacityMB(); capacity != 0 { + self.Capacity = capacity + } self.StorageConf = extStorage.GetStorageConf() self.Enabled = tristate.NewFromBool(extStorage.GetEnabled()) diff --git a/pkg/util/openstack/storage.go b/pkg/util/openstack/storage.go index 802a4fd0de..6277fa86f6 100644 --- a/pkg/util/openstack/storage.go +++ b/pkg/util/openstack/storage.go @@ -53,7 +53,7 @@ func (storage *SStorage) GetGlobalId() string { } func (storage *SStorage) IsEmulated() bool { - return true + return false } func (storage *SStorage) GetIZone() cloudprovider.ICloudZone {