Python help
-
All I want to do is be able to send force shut offs
Am i able to get help here?
def force_shutdown_vm(vm_uuid):
XO_URL = "https://192.168.100.30:2223/"
username = "ThePlague"
password = "NO"
context = ssl._create_unverified_context()
try:
session = XenAPI.Session(XO_URL,ignore_ssl=True)
session.set_ssl_context(context)
session.xenapi.login_with_password(username,password)
vm_ref = session.xenapi.VM.get_by_uuid(vm_uuid)
session.xenapi.VM.Clean_shutdown(vm_ref)
print("The VM Shutdown Successfully.")
except Exception as e:
print(f"Error: {e}")
finally:
session.xenapi.session.logout()
what am i doing wrong ahhahahahaha