def IxVmRemoveAllHypervisorsPy( ixNet ): # ixNet = object # Example: ixNet = IxNetwork.IxNet() & ixNet.connect(apiServer) availableHardware = ixNet.getList(ixNet.getRoot(), 'availableHardware')[0] vChassisObj = ixNet.getList(availableHardware, 'virtualChassis')[0] hypervisorList = ixNet.getList(vChassisObj, 'hypervisor') for eachHypervisor in hypervisorList: print 'Removing hypervisor:', eachHypervisor ixNet.remove(eachHypervisor) ixNet.commit() hypervisorList = ixNet.getList(vChassisObj, 'hypervisor') if len(hypervisorList) == 0: print 'removeAllHypervisors: verified good' return 1 else: print 'removeAllHypervisors: verified failed' return 0