IBM Virtual Servers in Bluemix now offers quite a few enhancements, including Block Storage. Let’s take a look: When I create a virtual server, I can still choose the location of where my VMs should run either the public openstack cloud or my own private cloud. Next I can select an existing image or upload my own. New with Bluemix is now I can upload from the OpenStack Application Catalog, which offers many additional image choices. Once I enter the name of my scalable group, I select the size and number of instances. That’s it…under the covers a heat template deploys an auto-scale group into the OpenStack cloud. Next, some new things: I can enter a post creation script to automate configuration after each VM is created. I can view network details, and I can select my security key I can also now select Security Groups. Through the Openstack CLI I can create additional groups, and then here select multiple groups that will layer firewall and access controls together. It’s quite flexible.
Once the VM group is running, I can monitor CPU, Network, and memory, but now lets activate block storage. For this demo, I’m going to open the catalog into a new tab, and search for Block. Note that in Bluemix, each space is mapped to an OpenStack project so one Block Storage instance will manage all volumes in an OpenStack project. OK. I found the block storage service, select it, and once I’m ready, click create. Once the service is active, I can create volumes and manage them. I can see an overview of metrics to keep track of usage, I can search for volumes, and click on an individual volume to perform actions. When I create a volume, I give it a name so I can keep track of it in this view, along with the size. The device name is assigned automatically. In this demo, I’m going to create two volumes that I can attach to my running VM. OK. Looks like both have been created, and now I want to attach the volumes to my running virtual server. Once the list of VMs is shown, I select the one I want, and the volume is attached.
Now let’s SSH into the VM so I can show the attached volume and how to format and mount the volume to the VM. I switch back to the virtual server tab so I can remember the IP address, and I bring down my terminal window. Notice that IBM-provided images contain the default userID “ibmcloud”, so you’ll want to use that when you SSH into the VM itself for the first time. Now that I’m in the VM, I type in the ‘list block’ command and it shows device vdb, the volume I attached. Just for kicks, lets go back to Bluemix to confirm that the Block service keeps track of the assigned device. Now I attach the second one. I click attach and once it’s attached I see it’s device name is VDC. Back in the terminal I enter “list block” again, and vdc is now attached. So now it’s basic linux commands. First, I’m going to format and create the file system. Next I’m going to create a mount point, and finally, mount the volume to the mount point, or folder, I just created. That’s it! Now I list the volumes again and it shows VDC is mounted to the gregInter02 folder.
Finally, lets look at extending volumes. With our beta, you have to detach the volume first no data will be lost, but it is a multi-step process. Once detached, select “Extend”, and then specify the target size. I then attach the newly extended volume, and go back to the terminal. I do want to confirm what device was automatically assigned to this attached volume and now back in the terminal I type “list block” again! Looks like the new 30GB drive is now ready to use! There’s always a chance the device name may differ, but just mount it to the same mount point and your apps won’t know any different. Of course since your VMs are running in a scalable group, when you want to add additional VM instances, you simply click the up arrow and Bluemix instantly creates more VMs based on the selected image and heat template configuration. The beauty of block storage is you can now move the data back and forth between these virtual servers.