mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Export Mininum Thin Pool Free Space through docker info
Right now there is no way to know what's the minimum free space threshold daemon is applying. It would be good to export it through docker info and then user knows what's the current value. Also this could be useful to higher level management tools which can look at this value and setup their own internal thresholds for image garbage collection etc. Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
This commit is contained in:
parent
c931a7c576
commit
55a9b8123d
3 changed files with 6 additions and 0 deletions
|
@ -167,6 +167,7 @@ type Status struct {
|
|||
// thin pool and it can't be activated again.
|
||||
DeferredDeleteEnabled bool
|
||||
DeferredDeletedDeviceCount uint
|
||||
MinFreeSpace uint64
|
||||
}
|
||||
|
||||
// Structure used to export image/container metadata in docker inspect.
|
||||
|
@ -2469,6 +2470,9 @@ func (devices *DeviceSet) Status() *Status {
|
|||
status.Metadata.Available = actualSpace
|
||||
}
|
||||
}
|
||||
|
||||
minFreeData := (dataTotal * uint64(devices.minFreeSpacePercent)) / 100
|
||||
status.MinFreeSpace = minFreeData * blockSizeInSectors * 512
|
||||
}
|
||||
|
||||
return status
|
||||
|
|
|
@ -74,6 +74,7 @@ func (d *Driver) Status() [][2]string {
|
|||
{"Metadata Space Used", fmt.Sprintf("%s", units.HumanSize(float64(s.Metadata.Used)))},
|
||||
{"Metadata Space Total", fmt.Sprintf("%s", units.HumanSize(float64(s.Metadata.Total)))},
|
||||
{"Metadata Space Available", fmt.Sprintf("%s", units.HumanSize(float64(s.Metadata.Available)))},
|
||||
{"Thin Pool Minimum Free Space", fmt.Sprintf("%s", units.HumanSize(float64(s.MinFreeSpace)))},
|
||||
{"Udev Sync Supported", fmt.Sprintf("%v", s.UdevSyncSupported)},
|
||||
{"Deferred Removal Enabled", fmt.Sprintf("%v", s.DeferredRemoveEnabled)},
|
||||
{"Deferred Deletion Enabled", fmt.Sprintf("%v", s.DeferredDeleteEnabled)},
|
||||
|
|
|
@ -109,6 +109,7 @@ The following command shows how to start the Docker daemon with the
|
|||
Metadata Space Used: 1.479 MB
|
||||
Metadata Space Total: 2.147 GB
|
||||
Metadata Space Available: 2.146 GB
|
||||
Thin Pool Minimum Free Space: 10.74 GB
|
||||
Udev Sync Supported: true
|
||||
Deferred Removal Enabled: false
|
||||
Data loop file: /var/lib/docker/devicemapper/devicemapper/data
|
||||
|
|
Loading…
Reference in a new issue