Loiseleur Michel
2010-Jun-14 08:46 UTC
[Ovirt-devel] [PATCH] Display available space in lvm pool
--- src/app/models/iscsi_storage_volume.rb | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/src/app/models/iscsi_storage_volume.rb b/src/app/models/iscsi_storage_volume.rb index fe2cbf5..0a0797d 100644 --- a/src/app/models/iscsi_storage_volume.rb +++ b/src/app/models/iscsi_storage_volume.rb @@ -19,7 +19,12 @@ class IscsiStorageVolume < StorageVolume def label_components - "#{storage_pool[:target]}:#{lun}" + available = self.size_in_gb - self.lvm_storage_pool.storage_volumes.total_size_in_gb if self.lvm_storage_pool + if self.lvm_storage_pool + "#{storage_pool[:target]}:#{lun} #{available}GB available" + else + "#{storage_pool[:target]}:#{lun}" + end end def volume_name -- 1.7.0.4
Arthur Clément
2010-Aug-17 09:43 UTC
[Ovirt-devel] [PATCH] Display available space in lvm pool
ACK and pushed On lundi 14 juin 2010 10:46:34 Loiseleur Michel wrote:> --- > src/app/models/iscsi_storage_volume.rb | 7 ++++++- > 1 files changed, 6 insertions(+), 1 deletions(-) > > diff --git a/src/app/models/iscsi_storage_volume.rb > b/src/app/models/iscsi_storage_volume.rb index fe2cbf5..0a0797d 100644 > --- a/src/app/models/iscsi_storage_volume.rb > +++ b/src/app/models/iscsi_storage_volume.rb > @@ -19,7 +19,12 @@ > > class IscsiStorageVolume < StorageVolume > def label_components > - "#{storage_pool[:target]}:#{lun}" > + available = self.size_in_gb - > self.lvm_storage_pool.storage_volumes.total_size_in_gb if > self.lvm_storage_pool + if self.lvm_storage_pool > + "#{storage_pool[:target]}:#{lun} #{available}GB available" > + else > + "#{storage_pool[:target]}:#{lun}" > + end > end > > def volume_name-- Arthur CLEMENT Linagora Paris