if machines are already in powered off the o/p is likely to be eg.:
2022/03/01 01:36:46 &{0x1120700 {0xc0001f6c60} 0x11d0e00} 400
2022/03/01 01:36:46 Problem stopping vm-5646, already in off state.
Terms and its meaning:
* ESXi is a product which provides virtualization.
* Vsphere is the name givne to the bundle of all features in the new version (ESXi, vcenter and its features so on).So ESXi is one of the product in vsphere.
👇 Click on the image for a new way to code review
- Make big changes easier — review code in small groups of related files
- Know where to start — see the whole change at a glance
- Take a code tour — explore the change with an interactive tour
- Make comments and review — all fully sync’ed with github
[Try it now!](https://app.codesee.io/r/reviews?pr=1408&src=https%3A%2F%2Fgithub.com%2FHarshCasper%2FRotten-Scripts)
Description
A simple go client for using vcenter/vmware REST api which can help you if you need to turn on/off multiple machines + check machines power status.
You need to have the api username and password to use this tool
Sample user/pass json file
First clone the repo and run build
cd into /path/to/repo
go build
Usage -help :
List vm's & get the vmid eg.
Output order - vmid , vmName,PoweredState , Memory(MB) , Num of cpu
Start vm's
Shutting down one or more vm's
if machines are already in powered off the o/p is likely to be eg.:
Terms and its meaning: