Groovy web console

subscribe to the feed Subscribe
to this

VMWare vSphere administration from Groovy

Published 1 decade ago by glaforge with tags vmware vsphere vijava administration remote
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
    Slightly Groovy-fied version of the following article:
    Ie. how to leverage the VI-Java API for managing your VMware VI3.x / vSphere environments

import import com.vmware.vim25.*

def si = new ServiceInstance("https://<ip address of vCenter or ESX>/sdk" as URL, "administrator", "password", true)
def rootFolder = si.rootFolder
println "Root folder: ${}"

new InventoryNavigator(rootFolder).searchManagedEntities("VirtualMachine").each {
    println """
        Hello ${}
        Guest OS: ${it.config.guestFullName}
        Multiple snapshots supported?: ${it.capability.isMultipleSnapshotsSupported()}