Created
October 2, 2020 03:00
-
-
Save codegold79/1bf596a407b9312960168de85674f901 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func generateRelocSpec() types.VirtualMachineRelocateSpec { | |
// Resource pool managed object reference | |
poolMOR := types.ManagedObjectReference{ | |
Type: "ResourcePool", | |
Value: "resgroup-1030", | |
} | |
// Host managed object reference | |
hostMOR := types.ManagedObjectReference{ | |
Type: "HostSystem", | |
Value: "host-1031", | |
} | |
// Datastore managed object reference | |
dsMOR := types.ManagedObjectReference{ | |
Type: "Datastore", | |
Value: "datastore-1032", | |
} | |
spec := types.VirtualMachineRelocateSpec{ | |
Host: &hostMOR, | |
Pool: &poolMOR, | |
Datastore: &dsMOR, | |
DiskMoveType: "moveAllDiskBackingsAndConsolidate", | |
} | |
return spec | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment