log more info about disk additions
This commit is contained in:
@@ -204,6 +204,14 @@ func (h *Handler) calculateNewDiskSize(event models.CloudEventReceived) float64
|
||||
// Calculate the total disk allocated in GB
|
||||
for _, device := range vmObject.Vm.Config.Hardware.Device {
|
||||
if disk, ok := device.(*types.VirtualDisk); ok {
|
||||
|
||||
// Print the filename of the backing device
|
||||
if backing, ok := disk.Backing.(*types.VirtualDiskFlatVer2BackingInfo); ok {
|
||||
h.Logger.Debug("Adding disk", "size_bytes", disk.CapacityInBytes, "backing_file", backing.FileName)
|
||||
} else {
|
||||
h.Logger.Debug("Adding disk, unknown backing type", "size_bytes", disk.CapacityInBytes)
|
||||
}
|
||||
|
||||
diskSize += float64(disk.CapacityInBytes / 1024 / 1024 / 1024) // Convert from bytes to GB
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user