turn off extra logging
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
9
main.go
9
main.go
@@ -123,7 +123,7 @@ func getScsiBusSharingVMs(client *govmomi.Client) error {
|
|||||||
|
|
||||||
// Iterate through VMs and check for SCSI bus sharing
|
// Iterate through VMs and check for SCSI bus sharing
|
||||||
for _, vm := range vmList {
|
for _, vm := range vmList {
|
||||||
fmt.Printf("vm : %s [%s]\n", vm.Name, vm.Summary.Runtime.Host)
|
//fmt.Printf("vm : %s [%s]\n", vm.Name, vm.Summary.Runtime.Host)
|
||||||
//fmt.Printf("vm parent: %v\n", vm.Parent)
|
//fmt.Printf("vm parent: %v\n", vm.Parent)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -141,7 +141,7 @@ func getScsiBusSharingVMs(client *govmomi.Client) error {
|
|||||||
// Determine cluster based on runtime host of VM based on https://github.com/vmware/govmomi/issues/1242#issuecomment-427671990
|
// Determine cluster based on runtime host of VM based on https://github.com/vmware/govmomi/issues/1242#issuecomment-427671990
|
||||||
for _, host := range hsList {
|
for _, host := range hsList {
|
||||||
if host.Reference() == *vm.Summary.Runtime.Host {
|
if host.Reference() == *vm.Summary.Runtime.Host {
|
||||||
fmt.Printf("host %s matches, host parent %s\n", host.Name, host.Parent)
|
//fmt.Printf("host %s matches, host parent %s\n", host.Name, host.Parent)
|
||||||
|
|
||||||
var cluster mo.ManagedEntity
|
var cluster mo.ManagedEntity
|
||||||
err = pc.RetrieveOne(ctx, *host.Parent, []string{"name"}, &cluster)
|
err = pc.RetrieveOne(ctx, *host.Parent, []string{"name"}, &cluster)
|
||||||
@@ -161,12 +161,13 @@ func getScsiBusSharingVMs(client *govmomi.Client) error {
|
|||||||
for _, device := range vm.Config.Hardware.Device {
|
for _, device := range vm.Config.Hardware.Device {
|
||||||
//fmt.Printf("device: %v\n", device)
|
//fmt.Printf("device: %v\n", device)
|
||||||
if scsi, ok := device.(types.BaseVirtualSCSIController); ok {
|
if scsi, ok := device.(types.BaseVirtualSCSIController); ok {
|
||||||
fmt.Printf("scsi: %v\n", scsi)
|
//fmt.Printf("scsi: %v\n", scsi)
|
||||||
controller := scsi.GetVirtualSCSIController()
|
controller := scsi.GetVirtualSCSIController()
|
||||||
//fmt.Printf("controller: %s\n", device.GetVirtualDevice().DeviceInfo.GetDescription().Label)
|
//fmt.Printf("controller: %s\n", device.GetVirtualDevice().DeviceInfo.GetDescription().Label)
|
||||||
fmt.Printf("VM %s is using SCSI bus sharing mode: %s\n", vm.Name, string(controller.SharedBus))
|
//fmt.Printf("VM %s is using SCSI bus sharing mode: %s\n", vm.Name, string(controller.SharedBus))
|
||||||
|
|
||||||
if controller.SharedBus != "noSharing" {
|
if controller.SharedBus != "noSharing" {
|
||||||
|
fmt.Printf("VM %s is using SCSI bus sharing mode: %s\n", vm.Name, string(controller.SharedBus))
|
||||||
result := BusSharingResults{
|
result := BusSharingResults{
|
||||||
VmName: vm.Name,
|
VmName: vm.Name,
|
||||||
ClusterName: clusterName,
|
ClusterName: clusterName,
|
||||||
|
Reference in New Issue
Block a user