mistio sends "Power Off" instead of "Shutdown" to vSphere hosted VMs
mistio = latest vSphere = ESXi 6.0U2
In working through GPU passthrough it was noted that mistio sends a "Power Off" message rather than a "Shutdown" message to ESXi to shutdown a VM. As the web ESXi client states:
Power off = "...Powering [the VM] off may cause loss of data in the guest."
Shut down = "Perform a graceful shutdown within the guest OS of the virtual machine."
mistio vSphere shut down messages should be adjusted to produce a normal Shut down of the VM rather an abnormal Power off.
Thanks for reporting, will make the change!
A bump to say I'm still interested in the change.
Hi Jake,
I will add this request to the feature backlog. Question for you: how many clouds and machines do you manage?
Cheers,
Mario ᐧ
Mario Olivarez
Mist.io 415-596-3088 | [email protected] 620 Folsom St. San Francisco, CA 94107
On Mon, Oct 3, 2016 at 9:26 AM, jpstaub [email protected] wrote:
A bump to say I'm still interested in the change.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mistio/mist.io/issues/882#issuecomment-251153777, or mute the thread https://github.com/notifications/unsubscribe-auth/AP0_4aLKp_yqN_20McdoRq68cEABfgjKks5qwSyggaJpZM4J7MhB .
This ought to help people trying to solve the shutdown problem. Of note, VMware doesn't seem all that interested in the graceful shutdown of VMs via the API either.
For those using ESXi as freeware: API functionality goes away after the initial (60 day) trial period for all but read commands. So, after the trial period, mistio will show ESXi VM status but it will not control them. Gaining access to the ESXi API after the trial period requires vSphere Essentials at a minimum. Google is your friend my friend to confirm this is no joke.
VMware Python Library - Used to interface with ESXi host via the command line
ESXi Python Command Line Tutorial - How to use Python to interact with ESXi
Note: connect.py in the VMware library contains an SSL certificate requirement which is not relevant for development work. To turn off the requirement --
Example path to connect.py
/usr/local/lib/python2.7/site-packages/pyVim/connect.py
Original code
def localSslFixup(host, sslContext):
Connections to 'localhost' do not need SSL verification as a certificate
will never match. The OS provides security by only allowing root to bind
to low-numbered ports.
if not sslContext and host in ['localhost', '127.0.0.1', '::1']:
import ssl
if hasattr(ssl, '_create_unverified_context'):
sslContext = ssl._create_unverified_context()
return sslContext
Modified code with added host of interest
def localSslFixup(host, sslContext):
Connections to 'localhost' do not need SSL verification as a certificate
will never match. The OS provides security by only allowing root to bind
to low-numbered ports.
if not sslContext and host in ['localhost', '127.0.0.1', '::1', 'your_host_IP_address']:
import ssl
if hasattr(ssl, '_create_unverified_context'):
sslContext = ssl._create_unverified_context()
return sslContext
Shutdown VM via Guest OS - Allows the graceful shutdown of VMs
Code required modification for it to work correctly.
Original code
except vmodl.MethodFault as error:
print("Caught vmodl fault : " + e.msg)
return -1
Modified code to correct print of error
except vmodl.MethodFault, e:
print("Caught vmodl fault : %s" % e.msg)
return -1
If working with ESXi outside the trial period when attempting to shutdown a VM gracefully the following will be the end result
Caught vmodl fault : Current license or ESXi version prohibits execution of the requested operation.