implement vc inventory scanning
This commit is contained in:
@@ -262,11 +262,11 @@ func (h *Handler) calculateNewDiskSize(event models.CloudEventReceived) float64
|
||||
if err != nil {
|
||||
h.Logger.Error("Can't locate vm in vCenter", "vmID", event.CloudEvent.Data.VM.VM.Value, "error", err)
|
||||
} else {
|
||||
if vmObject.Vm.Config != nil {
|
||||
if vmObject.Config != nil {
|
||||
h.Logger.Debug("Found VM with config, calculating new total disk size", "vmID", event.CloudEvent.Data.VM.VM.Value)
|
||||
|
||||
// Calculate the total disk allocated in GB
|
||||
for _, device := range vmObject.Vm.Config.Hardware.Device {
|
||||
for _, device := range vmObject.Config.Hardware.Device {
|
||||
if disk, ok := device.(*types.VirtualDisk); ok {
|
||||
|
||||
// Print the filename of the backing device
|
||||
|
Reference in New Issue
Block a user