How can I add tags to the just created virtual machine with pyvmomi?
See original GitHub issueHello all,
Spent almost whole day trying to find out how can I add tags to the just created virtual machine and all in vain. We use vSphere 6.0.0 at work. I tried to assign tags via vm.config.extraConfig
, they were set successfully but are not available in Tags section of Summary tab.
Could you share a piece of code how can I achieve this.
Thank you. Look forward to hearing from you.
Issue Analytics
- State:
- Created 8 years ago
- Reactions:4
- Comments:43 (15 by maintainers)
Top Results From Across the Web
How can I add tags to the just created virtual machine with ...
Hello all,. Spent almost whole day trying to find out how can I add tags to the just created virtual machine and all...
Read more >Get VM tags using pyvmomi in vSphere 6.5 - Stack Overflow
After going through all VMs in the cluster, this is the only machine that is apparently having a tag. Btw, I already created...
Read more >Add VM Extra Config Tags - Samples - VMware {code}
Adds additional args to allow the vm uuid to be set. pyvmomi-community-samples Community contributed samples for the pyVmomi library. The pyVmomi l...
Read more >community.vmware.vmware_guest module – Manages virtual ...
This module can be used to create new virtual machines from templates or other virtual machines, manage power state of virtual machine such ......
Read more >pyvmomi · PyPI
pyVmomi is the Python SDK for the VMware vSphere API that allows you to manage ESX, ESXi, and vCenter. Getting Started. To get...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Here is a sample to show how to create a Tag, a Tag Category and tag a Cluster/VM using basic auth(username/password). The sample skips the server certificate verification for simplicity sake which should be avoided in production code:
Is there a technical reason why the tagging API is only available via pyvcloud and not this project?
Agree with @stagor’s sentiment that having the functionality available in pyvmomi would be preferable since it has a more substantial community following and significantly better documentation (e.g., community examples and StackOverflow QAs).
Also, @tianhao64, can you please post a link to the non-SSO example? I’d like to take a look. TIA.