Stopping an instance
Sometimes, an instance will need to be stopped for a number of reasons, for example, maintenance and offline migration, yet as an OpenStack administrator, you may not want to completely destroy the instance and data associated with it. Thus, you will want to stop the instance instead.
Getting ready
To stop an instance, you will need the following:
The
openstack
command-line clientThe
openrc
file containing appropriate credentialsThe name of the instance
How to do it…
In this example, we will be stopping the cookbook.test
instance created in the Booting an instance recipe. To stop the instance, use the following steps:
First, we list the running instances:
openstack server list
This will bring back a list of the running instances. Consider this example:
To stop the instance, simply issue the following command:
openstack server stop cookbook.test
Note
This command takes a few moments to complete and will not display the output if successful.
Now list instances to confirm the status...