Skip to content

Instantly share code, notes, and snippets.

@miyadav
Last active September 13, 2022 10:26
Show Gist options
  • Save miyadav/5e44af24af9752d945dd1e4f65cb0363 to your computer and use it in GitHub Desktop.
Save miyadav/5e44af24af9752d945dd1e4f65cb0363 to your computer and use it in GitHub Desktop.
for creating bulk categories
#!/bin/bash
count=$1
for i in $(seq $count); do
govc tags.create -c "testtagscachecategory"$i "tagscache"$i
done
#!/bin/bash
count=$1
for i in $(seq $count); do
govc tags.category.create -d "testcache"$i "testtagscachecategory"$i
done
#!/bin/bash
count=$1
for i in $(seq $count); do
govc tags.category.rm "testtagscachecategory"$i
done
#!/bin/bash
count=$1
for i in $(seq $count); do
govc tags.rm -f -c "testtagscachecategory"$i "tagscache"$i
done
export GOVC_URL=https://xxx.xxxx-xx-xxx-xxx.vmwarevmc.com
export GOVC_USERNAME=xxxx@xxxx.xyz
export GOVC_PASSWORD=xxxxxxxx
export URL=https://xxxxxx.com
Export above variables and then pass the count to the above shell scripts to create categories
Refer for more - https://github.com/vmware/govmomi/blob/master/govc/USAGE.md
to Download cli use - https://github.com/vmware/govmomi/blob/master/govc/README.md#binaries
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment