Suspending and Restarting the OpenStack Cookbook Lab

In our previous post about Installing the OpenStack Cookbook on OSX, we explored the simple first steps needed to get our OpenStack lab environment up and running on OSX. This is OSX specific, but quite similar to the lab being run on Windows and Linux. I will put together a quick post to show how to do the same on Windows and Linux also.

Because we want to manage our resources by bringing the systems down and up on occasion, it is important that we know how to quiesce the lab instances, and to be able to rebuild the lab from scratch when it is already deployed.

Suspending and Restarting your OpenStack Cookbook Lab

Luckily, there’s a blog for that! I had written in the past about how to suspend and resume a number of virtual machines using vagrant and awk here: https://discoposse.com/2014/10/12/suspend-and-resume-vagrant-boxes-in-bulk-osx-linux/ which will give you the ability to quiesce and to spin up your OpenStack Cookbook lab easily.

Remember that your lab will use resources such as CPU, RAM, and most importantly power. I have been bitten by this in the past where I left a number of virtual instances running in the background while on battery and my laptop did see a rather rapid reduction in battery time as a result.

Deleting the OpenStack Cookbook Lab

There may be events that require you to remove the OpenStack Cookbook lab from your host. This could be to update the code, test some parts of the build, or it could be to correct an issue that may have occurred which is easier to recover from by rebuilding the lab in its entirety.

Removing the OpenStack Cookbook lab from your environment is done easily using the vagrant destroy command while in the home folder of the lab. You will be prompted for each machine as it begins the process of removing the VM:

vagrant-destroy

You can also use the vagrant destroy -f command instead but tread carefully as this command will run without questioning you at all. The -f parameter is an option to force the command without confirmation:

vagrant-destroy-f

Because this affects the NFS exports that were created to share the /vagrant/ folder to your local host machine, you will be prompted for credentials to remove the NFS attachments:

nfs-password-remove

Once it is all done, you will see the resulting screen as follows:

destroy-done

Once done that, you can simply rebuild the lab by going back to the vagrant up part of the process and you will be back to stacking up the goodness again.

1 thought on “Suspending and Restarting the OpenStack Cookbook Lab”

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.