Comment 12 for bug 2003940

Revision history for this message
Anton Troyanov (troyanov) wrote :

Thanks Kevin!

I confirm that `machine.list` and `machine.get` return different values for `physical_disk_count` and `storage`.

You mentioned:
> bmhv9.maas 10.24TB 2560.5GB over 2 disks (1x 512GB + 1x 2048GB)

And how many VMs do you have on `bmhv9.maas`? It seems that all the values are simply multiplied by 4 (do you have 4 VMs there?)

For the reference:
In both cases `dehydrate` method of NodeHandler is called (websockets/handlers/node.py)

But for `list` we take values from `physical_disk_count` and `total_storage` returned by Meta.list_queryset (websockets/handlers/machine.py)

physical_disk_count=Count(
  "current_config__blockdevice__physicalblockdevice"
),
total_storage=Sum(
  "current_config__blockdevice__physicalblockdevice__size"
)

And for `get` we do calculation in a bit difference way (which seems to be a correct one).