April 2018
Intermediate to advanced
280 pages
8h 37m
English
A virtual machine may have to be rebooted in certain situations such as after installing specific software packages and so on. We can either perform a HARD reboot, which is similar to pressing the reset button, or we could perform a SOFT reboot, which ensures a graceful shutdown of all running applications before the VM is rebooted.
The function reboot_server() accepts two parameters, the Server class object or ID of the instance and the type of reboot (SOFT or HARD). The following program demonstrates a HARD reboot of a VM:
def reboot_server(conn): server_id="7cdaa375-f1b5-40ab-81bd-7e3d052f370d" conn.compute.reboot_server(server_id, "HARD")