[openstack-dev] [heat] raw volume attachment and format in cloud config

Vignesh Kumar vickyramuk4u at gmail.com
Wed Feb 18 20:27:19 UTC 2015


Hi All,

I am trying to attach a raw volume to a server node and format it. All done
in one go using a heat template.


   1. The volume is attached using OS::Cinder::VolumeAttachment
   2. The node is created using OS::Nova::Server and it is created from a
   coreOS image
   3. I am using the cloud config in the OS::Nova::Server to format and
   mount the volume attached using a script.
   4. The instance is a coreOS instance and I am using a unit service to
   start the sh script which performs the formatting and mounting of the
   volume as follows.

#!/bin/sh
        sudo mkdir -p /dev/external
        while [ ! -e /dev/vdb ]
        do
           echo Waiting for volume to attach
           sleep 10
        done
        sudo mount -t ext4 /dev/vdb /dev/external/
        if [ $? -eq 0 ]
        then
          sudo echo "Already Formatted Volume. Mounted"
        else
          sudo /usr/sbin/mkfs.ext4 /dev/vdb
          sudo mount -t ext4 /dev/vdb /dev/external/
          sudo echo "RAW Volume. Formatted and mounted"
        fi
        sudo echo "Volume mounted"


What happens then is the stack gets created. But cannot ssh into the
instance. Sometimes it takes much longer than that and sometime boot never
happens. Sometimes after creating the stack I am able to ssh into the new
node with the formatted volume. But mostly no.

The same formatting and mounting if done manually rather than in cloud
config  works perfectly fine. Any pointers on what is happening here will
be helpful .

Regards,
Vignesh Kumar Kathiresan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20150218/39760295/attachment.html>


More information about the OpenStack-dev mailing list