Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
tests adding overlay wrapper for interactive experiments Jul 25, 2014
tools Fixed problem with pbmhelper function response May 22, 2019
README.md Samples Documentation Jul 24, 2014
__init__.py make testing actually possible Jul 24, 2014
add_disk_to_vm.py add_disk_to_vm: Fix unintialized variable if there are no disks attac… Jan 12, 2017
add_nic_to_vm.py Add opaque network to created, cloned VM Feb 1, 2019
add_portgroup_to_vswitch.py Adding 2 more arguments: Jul 1, 2017
add_raw_disk_to_vm.py add example to add a raw disk to a VM (#584) Jul 23, 2019
add_vm_extra_config_tags.py Fixed inconsistent usage of including #!/usr/bin/env python in the fi… May 6, 2015
add_vm_nic_to_dvs.py Fix inconsistent permissions Oct 25, 2017
add_vswitch_to_host.py Sample to add vswitch to host. Oct 26, 2016
cdrom_vm.py Fix inconsistent permissions Oct 25, 2017
change_disk_mode.py Fix inconsistent permissions Oct 25, 2017
change_vm_cd_backend.py Fix inconsistent permissions Oct 25, 2017
change_vm_nic_state.py Fix inconsistent permissions Oct 25, 2017
change_vm_vif.py Fixed inconsistent usage of including #!/usr/bin/env python in the fi… May 6, 2015
clone_vm.py Add opaque network to created, cloned VM Feb 1, 2019
configure_dvs_port_group.py Added sample for configuring distributed port group Dec 11, 2018
create_folder_in_datacenter.py Fix inconsistent permissions Oct 25, 2017
create_random_marvel_vms.py Add opaque network to created, cloned VM Feb 1, 2019
create_snapshot.py Fix inconsistent permissions Oct 25, 2017
del_portgroup_from_vswitch.py Sample to del portgroup from vswitch. Oct 26, 2016
del_vswitch_from_host.py Sample to del vswitch from host. Oct 26, 2016
delete_disk_from_vm.py Fix inconsistent permissions Oct 25, 2017
delete_nic_from_vm.py Sample to delete virtual ethernet card from VM Sep 27, 2016
deploy_ova.py Fix inconsistent permissions Oct 25, 2017
deploy_ovf.py Fixes #556 Apr 8, 2019
destroy_vm.py Really squelch pep8 snark Mar 2, 2017
detach_disk_from_vm.py Migrated functions to libraries May 16, 2019
esxi_perf_sample.py making python2/3 compatible Oct 21, 2015
execute_program_in_vm.py Fix inconsistent permissions Oct 25, 2017
export_vm.py Fix inconsistent permissions Oct 25, 2017
fcd_attach_vdisk_to_vm.py Added fcd prefix to scripts May 28, 2019
fcd_create_vdisk.py Added fcd prefix to scripts May 28, 2019
fcd_create_vdisk_from_snapshot.py Added fcd prefix to scripts May 28, 2019
fcd_create_vdisk_snapshot.py Added fcd prefix to scripts May 28, 2019
fcd_delete_vdisk.py Added fcd prefix to scripts May 28, 2019
fcd_delete_vdisk_snapshot.py Added fcd prefix to scripts May 28, 2019
fcd_list_vdisk_snapshots.py Added fcd prefix to scripts May 28, 2019
filter_vms.py Fix inconsistent permissions Oct 25, 2017
find_by_uuid.py Fixed inconsistent usage of including #!/usr/bin/env python in the fi… May 6, 2015
generate_html5_console.py Fixed pep8 errors Dec 10, 2015
get_hosts_vswitch.py Sample to get vswitches. Oct 26, 2016
get_portgroup.py Retrieves Port Group (#596) Sep 26, 2019
get_vm_names.py pep8 happiness Mar 3, 2017
get_vm_storage_policy.py Added sample of using VMware Storage Policy API (#571) Aug 7, 2019
getallvms.py This new sample file prints a list of VMs according to a provided str… Aug 1, 2019
getorphanedvms.py Fixed inconsistent usage of including #!/usr/bin/env python in the fi… May 6, 2015
getvmsbycluster.py modified: samples/getvmsbycluster.py Jan 3, 2019
getvnicinfo.py Fix inconsistent permissions Oct 25, 2017
hello_world_vcenter.py pep8 cleanup on hello_world_vcenter. This makes pep8 tool and pylint … Jun 16, 2014
hello_world_vcenter_with_yaml_recorder.py [sample] vcrpy as flight recorder Oct 3, 2014
linked_clone.py Fix inconsistent permissions Oct 25, 2017
list_datastore_cluster.py pep8 cleanup on list_datastore_cluster. This makes pylint and pep8 to… Jun 16, 2014
list_datastore_info.py Add ssl verification flag to list_datastore_info Mar 2, 2016
list_dc_datastore_info.py Fix inconsistent permissions Oct 25, 2017
list_host_alarms.py Fixed inconsistent usage of including #!/usr/bin/env python in the fi… May 6, 2015
list_vlan_in_portgroups.py New list_vlan_in_portgroups.py (#590) Jul 22, 2019
list_vm_storage_policy.py Fix compatibility on "_create_unverified_context" of module ssl (#383) Jun 19, 2017
list_vmwaretools_status.py Fix inconsistent permissions Oct 25, 2017
make_dc_and_cluster.py Fixed inconsistent usage of including #!/usr/bin/env python in the fi… May 6, 2015
nsxt_change_vm_vif.py Add opaque network to created, cloned VM Feb 1, 2019
pyvmomi-to-suds.py pep8 E402 module level import not at top of file Apr 20, 2015
reboot_vm.py honor the --disable_ssl_verification flag Feb 6, 2019
reconfigure_host_for_ha.py Fixed pep8 errors Jan 25, 2016
relocate_events.py Fix inconsistent permissions Oct 25, 2017
relocate_vm.py Added license and author to the relocate_vm sample Dec 6, 2018
renamer.py updates to make pep8 happy Jun 26, 2014
scheduled_poweroff.py Fix inconsistent permissions Oct 25, 2017
service_manager_esxtop_in_vc.py Fix compatibility on "_create_unverified_context" of module ssl (#383) Jun 19, 2017
service_manager_vscsistats_in_vc.py Fix compatibility on "_create_unverified_context" of module ssl (#383) Jun 19, 2017
sessions_list.py Fixes #520: Py3 compatibility and printing username and ipAddress (#613) Oct 15, 2019
set_note.py Updating to support py3 Oct 26, 2018
set_vcenter_motd.py Moving module to top Mar 8, 2016
set_vm_storage_policy.py Added sample of using VMware Storage Policy API (#571) Aug 7, 2019
snapshot_operations.py Make use of WaitForTask from pyVim.task Nov 21, 2016
soft_reboot.py making python2/3 compatible Oct 21, 2015
suds-to-pyvmomi.py pep8 E402 module level import not at top of file Apr 20, 2015
update_esxi_advanced_settings.py Adding few ESXi samples (#360) May 17, 2017
update_vm_storage_policy.py Fix compatibility on "_create_unverified_context" of module ssl (#383) Jun 19, 2017
upgrade_vm.py
upload_file_to_datastore.py fix pep8 / whitespace Aug 28, 2017
upload_file_to_vm.py upload file will not overwrite args anymore (#597) Sep 20, 2019
vSphereAutoRestartManager.py update First revision of vSphereAutoRestartManager Jan 7, 2015
vcenter_details.py Python3 support and SSL fix Jun 29, 2016
virtual_machine_device_info.py grammar fixes Feb 28, 2018
virtual_machine_power_cycle_and_question.py Fixed inconsistent usage of including #!/usr/bin/env python in the fi… May 6, 2015
vm_perf_example.py Get ride of a print statement Aug 8, 2018
vminfo_quick.py Fixed inconsistent usage of including #!/usr/bin/env python in the fi… May 6, 2015
waitforupdates.py pep8 W503 line break before binary operator Apr 20, 2015

README.md

Executable Samples

This directory contains a collection of executable sample scripts that use the pyVmomi library. There is a tools directory that holds a collection of tools and a tests directory that holds the tests for those tools.

Quality and License

Scripts are provided as-is by numerous contributors and the status of any sample at any point is subject to change. The project is intended as a collaborative exercise in community learning and may not contain best practice methods.

All samples revert to the license of the project and all ownership reverts to the community project.

Contribution Notes

  • If a script is in this directory, it is an executable sample.
  • conform to pep8
  • avoid using any special tools beyond pyvmomi.
  • do not extend the pyVmomi API in this project we have two separate projects dedicated to that.
  • tests are appreciated but optional because of this sample quality must be manually assessed bug reports and fixes are much appreciated.
  • A reviewer will pull a new sample for testing and will attempt to run the sample. If the reviewer can do this, the sample can be merged

Getting Help

You can’t perform that action at this time.