0

I would like to list all template available un my vCenter.

I dont know how do this. I try to get all object in content.rootFolder and compare if it's a virtualmachine or not. But I can't find templates.

I see i can do this: container = content.viewManager.CreateContainerView( content.rootFolder, [[vim.VirtualMachine]], True)

but nothing,

thanks for ur help. With that, I suppose I am able to find a specific template.

Anthony
  • 177
  • 1
  • 4
  • 14

1 Answers1

0

You are looking for vm.config.template if that property is true the VirtualMachine is marked as a template. You should be using a property collector to make your code fast. Take a look at this sample. There is a list of vm_properties starting on line 38. You could remove them and just use "name" and "config.template" if those are the only things you care about. Then modify the printing at the bottom.. add a simple if vm["config.template"]: xxx so it only printed if that property was set.. something like that.

Michael Rice
  • 7,974
  • 1
  • 15
  • 18