8.11. Controlling Instance State (Suspend, Resume, Reboot, Terminate)
Up to this point you have only booted up instances. There are some other commands that can be used to adjust instance state. You can suspend, resume, reboot, and terminate an instance. The following commands show some examples of doing a suspend, resume, and reboot. Terminating instances is covered in Section 8.12, “Deleting Instances”.
$nova list+--------------------------------------+-------------------+--------+------------------+ | ID | Name | Status | Networks | +--------------------------------------+-------------------+--------+------------------+ | 0e4011a4-3128-4674-ab16-dd1b7ecc126e | rhel | ACTIVE | demonet=10.0.0.2 | | ac9e6a9f-58c3-47c3-9b4c-485aa421b8a8 | snapshot-instance | ACTIVE | demonet=10.0.0.4 | | b8d5c952-f2fc-4556-83f2-57c79378d867 | rhel2 | ACTIVE | demonet=10.0.0.3 | +--------------------------------------+-------------------+--------+------------------+$nova suspend ac9e6a9f-58c3-47c3-9b4c-485aa421b8a8$ping 10.0.0.4# should not get a response PING 10.0.0.4 (10.0.0.4) 56(84) bytes of data. Ctrl+c --- 10.0.0.4 ping statistics --- 3 packets transmitted, 0 received, 100% packet loss, time 2879ms$nova resume ac9e6a9f-58c3-47c3-9b4c-485aa421b8a8$ping 10.0.0.4PING 10.0.0.4 (10.0.0.4) 56(84) bytes of data. 64 bytes from 10.0.0.4: icmp_seq=1 ttl=64 time=1685 ms 64 bytes from 10.0.0.4: icmp_seq=2 ttl=64 time=685 ms 64 bytes from 10.0.0.4: icmp_seq=3 ttl=64 time=0.451 ms 64 bytes from 10.0.0.4: icmp_seq=4 ttl=64 time=0.394 ms Ctrl+c --- 10.0.0.4 ping statistics --- 4 packets transmitted, 4 received, 0% packet loss, time 3607ms$nova reboot ac9e6a9f-58c3-47c3-9b4c-485aa421b8a8$ssh -i oskey.priv root@10.0.0.4Last login: Fri May 18 09:50:38 2012 from 10.0.0.1vm$uptime09:59:09 up 0 min, 1 user, load average: 0.15, 0.03, 0.01