Skip to content
Snippets Groups Projects
Commit 5edc23b1 authored by František Řezníček's avatar František Řezníček
Browse files

Merge branch 'instance-shelving' into 'master'

feature - Creating Instance shelving tutorial

See merge request !46
parents 7f7a6f0a 0efac811
No related branches found
No related tags found
1 merge request!46feature - Creating Instance shelving tutorial
Pipeline #298861 failed
topics/compute/openstack/docs/images/instance-shelving/shelving.png

113 KiB

topics/compute/openstack/docs/images/instance-shelving/shelving_status.png

28 KiB

topics/compute/openstack/docs/images/instance-shelving/unshelving.png

42.8 KiB

---
title: Instance shelving
search:
exclude: false
---
# Instance shelving
[OpenStack instance shelving](https://docs.openstack.org/ocata/user-guide/cli-stop-and-start-an-instance.html#shelve-and-unshelve-an-instance) allows you to stop an instance without having it consume any cloud hypervisor resources. A shelved instance will be retained as a bootable instance, as well as its resources assigned, such as an IP address in distributed storage, for a configurable amount of time, and then deleted. This is useful as part of an instance life cycle process or to conserve resources.
## What instance shelving does ?
It creates a snapshot of the state of **running** instance, containing instance data and resource allocations. Data in memory is **not** retained, however. The instance then goes into **Shelved Offloaded** state and shuts itself down. Once the instance is required again, it is **unshelved** and restored to a running state with all resources and data.
## How to shelve your instance ?
There are two possible ways to shelve your instance:
1. Via GUI
2. Via command line
### GUI shelving
Go into your instance list, located at the left menu bar on the path **Project>Compute>Instances**. Then you select the **Actions** menu located on the right side of the listed instances. After that, choose the **running** instance to shelve and select from the **Actions** menu the option **Shelve Instance** and click it.
![](/compute/openstack/images/instance-shelving/shelving.png)
Once the shelving process is finished, you can check that the instance is in the status **Shelved Offloaded** and its power state is **Shut Down**.
![](/compute/openstack/images/instance-shelving/shelving_status.png)
Now the instance is offloaded from the computational host, and you can use resources from the shelved instance.
Once you are finished and wish to restore your instance into a running state, go and select from **Actions** menu the option **Unshelve Instance** and click it.
![](/compute/openstack/images/instance-shelving/unshelving_status.png)
### CLI shelving
Select an instance in **Active** status from the list of instances you wish to shelve.
```
# openstack server list --status active
+--------------------------------------+--------------+--------+--------------------------------------+-------+---------------+
| ID | Name | Status | Networks | Image | Flavor |
+--------------------------------------+--------------+--------+--------------------------------------+-------+---------------+
| 59f02d12-**************-f02d7731d13c | vm-to-shelve | ACTIVE | ******************** | | standard.tiny |
+--------------------------------------+--------------+--------+--------------------------------------+-------+---------------+
```
Use the following command to shelve that instance.
```
openstack server shelve {NAME_OF_INSTANCE|ID_OF_INSTANCE}
```
After that, you can check that the selected instance is no longer in **Active** status. It is in **Shelved Offloaded**. Resources were freed and are now at your disposal and ready to use.
```
# openstack server shelve vm-to-shelve
# openstack server list --status active
# openstack server list
+--------------------------------------+--------------+-------------------+--------------------------------+-------+---------------+
| ID | Name | Status | Networks | Image | Flavor |
+--------------------------------------+--------------+-------------------+--------------------------------+-------+---------------+
| 59f02d12-**************-f02d7731d13c | vm-to-shelve | SHELVED_OFFLOADED | ******************* | | standard.tiny |
+--------------------------------------+--------------+-------------------+--------------------------------+-------+---------------+
```
After you are finished with your work, you can easily restore the shelved instance by running this command:
```
openstack server unshelve {NAME_OF_INSTANCE|ID_OF_INSTANCE}
```
Once the command is finished, you can check if your instance is restored and in a running state.
```
# openstack server unshelve vm-to-shelve
# openstack server list --status active
+--------------------------------------+--------------+--------+--------------------------------------+-------+---------------+
| ID | Name | Status | Networks | Image | Flavor |
+--------------------------------------+--------------+--------+--------------------------------------+-------+---------------+
| 59f02d12-**************-f02d7731d13c | vm-to-shelve | ACTIVE | ******************** | | standard.tiny |
+--------------------------------------+--------------+--------+--------------------------------------+-------+---------------+
```
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment