VMware Cloud Community
venkatad
Contributor
Contributor
Jump to solution

trying to poweroff and poweron VM through CLI or script

Hi All,

I am looking for options to reboot the VM using CLI or script. I tried using ovftool but looks like there is no way using ovftool just to power-off and power-on? is there any way I Can achieve rebooting VM through CLI / Script? I might need to have some power down time between power off and power on cycles.

Part of our automation i would like to perform this for certain use case validations.

--

Thanks in advanced,

Venkata

0 Kudos
1 Solution

Accepted Solutions
venkatad
Contributor
Contributor
Jump to solution

Hi all,

I was able to achieve Power cycling using python API pyVmomi. GitHub - vmware/pyvmomi: VMware vSphere API Python Bindings

Thanks every one for pointing me to right direction, when scott moved this ticket to vSphere that helped to move in right direction and look for vsphere API and ended up finding https://github.com/vmware/pyvmomi/

GitHub - vmware/pyvmomi: VMware vSphere API Python Bindings

View solution in original post

0 Kudos
6 Replies
scott28tt
VMware Employee
VMware Employee
Jump to solution

Which VMware product?


-------------------------------------------------------------------------------------------------------------------------------------------------------------

Although I am a VMware employee I contribute to VMware Communities voluntarily (ie. not in any official capacity)
VMware Training & Certification blog
0 Kudos
venkatad
Contributor
Contributor
Jump to solution

Hi Scott,

vSphere Client version 6.7.0.42000 (web)

ovftool  version: VMware ovftool 4.4.0 (build-15722219)

VMware ESXi, 6.0.0, 5572656

--

Thanks,

Venkat

0 Kudos
scott28tt
VMware Employee
VMware Employee
Jump to solution

Moderator: Thread moved to the vSphere area.


-------------------------------------------------------------------------------------------------------------------------------------------------------------

Although I am a VMware employee I contribute to VMware Communities voluntarily (ie. not in any official capacity)
VMware Training & Certification blog
0 Kudos
daphnissov
Immortal
Immortal
Jump to solution

OVFtool is not a CLI tool for operations on VMs. Look at PowerCLI.

0 Kudos
venkatad
Contributor
Contributor
Jump to solution

Hi all,

I was able to achieve Power cycling using python API pyVmomi. GitHub - vmware/pyvmomi: VMware vSphere API Python Bindings

Thanks every one for pointing me to right direction, when scott moved this ticket to vSphere that helped to move in right direction and look for vsphere API and ended up finding https://github.com/vmware/pyvmomi/

GitHub - vmware/pyvmomi: VMware vSphere API Python Bindings

0 Kudos
daphnissov
Immortal
Immortal
Jump to solution

Feel free to mark your own answer as correct for the benefit of others in the future.

0 Kudos