more logging
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2023-10-26 12:38:11 +11:00
parent 429e5f1a44
commit 082c99afa9

View File

@@ -83,6 +83,7 @@ func getScsiBusSharingVMs(client *govmomi.Client) error {
pc := property.DefaultCollector(client.Client)
// Get a view of all the VMs
fmt.Printf("Getting VM listing\n")
vms, err := m.CreateContainerView(ctx, client.ServiceContent.RootFolder, []string{"VirtualMachine"}, true)
if err != nil {
return err
@@ -90,6 +91,7 @@ func getScsiBusSharingVMs(client *govmomi.Client) error {
defer vms.Destroy(ctx)
// Get a view of all the hosts
fmt.Printf("Getting host listing\n")
hs, err := m.CreateContainerView(ctx, client.ServiceContent.RootFolder, []string{"HostSystem"}, true)
if err != nil {
return err
@@ -103,6 +105,7 @@ func getScsiBusSharingVMs(client *govmomi.Client) error {
log.Printf("Error retrieving vm list : '%s'\n", err)
return err
}
fmt.Printf("Found %d VMs\n", len(vmList))
// Retrieve all the hosts
var hsList []mo.HostSystem
@@ -111,6 +114,7 @@ func getScsiBusSharingVMs(client *govmomi.Client) error {
log.Printf("Error retrieving hostsystem list : '%s'\n", err)
return err
}
fmt.Printf("Found %d hosts\n", len(hsList))
// Iterate through VMs and check for SCSI bus sharing
for _, vm := range vmList {
@@ -141,7 +145,7 @@ func getScsiBusSharingVMs(client *govmomi.Client) error {
}
//fmt.Println(cluster.Name)
clusterName = cluster.Name
break
}
}