[Openstack] How resize works
Today, micro service was going down intermittently and it was not good for a production environment. After doing many checks, finally I reached the conclusion to resize memory of my instance.
I would like to share the steps that I did and prerequisite checks that I did to resize memory on my instance. Let’s get started.
We can resize an instance by changing it’s flavor. While we change the flavor, this rebuild the instance and results in a restart. This is the basic thing we want to understand about resizing an instance in Openstack. Also make sure that the number of cpu matches for our instance and the flavor that we are planning for.
The commands are as follows.
- Find the instance we want to resize to
:~# nova list | grep 'drm-prov-production'
| 87b8faf8–4769–44a5-bf7e-3760663cded0 | drm-prov-production-01 | ACTIVE | - | Running | tpc1-net=<ipaddress> |
| 25b65fc8–0319–4003-bea4–67a9bc838de2 | drm-prov-production-02 | ACTIVE | - | Running | tpc1-net=<ipaddress> |
| 55b25830-e5ec-4417-a457–16ae89c57061 | drm-prov-production-03 | ACTIVE | - | Running | tpc1-net=<ipaddress> |
2. Take a note of the present flavor of instance
# nova show drm-prov-production-01 | grep flavor
| flavor | flavor.c4.r8 (2652fe90-4ffc-4161-a680-463d438bfc69)
3. Resize the instance with our desired flavor.
:~# nova resize drm-prov-production-01 flavor.c4.r16 --poll Server resizing... 100% complete
Finished
:~#:~# nova list | grep 'drm-prov-production'
| 87b8faf8–4769–44a5-bf7e-3760663cded0 | drm-prov-production-01 | ACTIVE | - | VERIFY_RESIZE | tpc1-net=<ipaddress> |
| 25b65fc8–0319–4003-bea4–67a9bc838de2 | drm-prov-production-02 | ACTIVE | - | Running | tpc1-net=<ipaddress> |
| 55b25830-e5ec-4417-a457–16ae89c57061 | drm-prov-production-03 | ACTIVE | - | Running | tpc1-net=<ipaddress> |
4. Confirm the resize
Notice the VERIFY_RESIZE message in status. This is the time, we are good to resize by confirming our operation.
nova resize-confirm drm-prov-production-01
This operation will perform the resize and once things are completed, we can check the status to see if the instances are running fine.
This is a small blog, which shows the basic commands to do a resize operation in Openstack. I will get more into issues that we get while resizing and how to troubleshoot those issues in coming series of blogs.
Thanks for reading. Have a great day ahead.