Skip to content

Commit

Permalink
incusd/storage: Handle default disk size in GetInstanceUsage
Browse files Browse the repository at this point in the history
Signed-off-by: Stéphane Graber <[email protected]>
  • Loading branch information
stgraber committed Dec 2, 2024
1 parent 1e6cf48 commit 43ecfd5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/server/storage/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -2719,7 +2719,11 @@ func (b *backend) GetInstanceUsage(inst instance.Instance) (*VolumeUsage, error)
}

sizeStr, ok := rootDiskConf["size"]
if ok {
if !ok && volType == drivers.VolumeTypeVM {
sizeStr = drivers.DefaultBlockSize
}

if sizeStr != "" {
total, err := units.ParseByteSizeString(sizeStr)
if err != nil {
return nil, err
Expand Down

0 comments on commit 43ecfd5

Please sign in to comment.