<div dir="ltr">Hi All,<div><br></div><div>I am trying to attach a raw volume to a server node and format it. All done in one go using a heat template. </div><div><br></div><div><ol><li>The volume is attached using OS::Cinder::VolumeAttachment<br></li><li>The node is created using OS::Nova::Server and it is created from a coreOS image</li><li>I am using the cloud config in the OS::Nova::Server to format and mount the volume attached using a script.<br></li><li>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.</li></ol></div><div><pre class="" style="overflow:auto;font-family:Menlo,Monaco,Consolas,'Courier New',monospace;font-size:12px;padding:8.5px;margin-top:0px;margin-bottom:9px;line-height:1.42857;word-break:break-all;word-wrap:break-word;color:rgb(51,51,51);border:1px solid rgb(204,204,204);border-radius:4px;background-color:rgb(245,245,245)"><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;line-height:normal;white-space:normal;background-color:rgb(255,255,255)">#!/bin/sh</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;line-height:normal;white-space:normal;background-color:rgb(255,255,255)">        sudo mkdir -p /dev/external<br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;line-height:normal;white-space:normal;background-color:rgb(255,255,255)">        while [ ! -e /dev/vdb ]</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;line-height:normal;white-space:normal;background-color:rgb(255,255,255)">        do</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;line-height:normal;white-space:normal;background-color:rgb(255,255,255)">           echo Waiting for volume to attach</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;line-height:normal;white-space:normal;background-color:rgb(255,255,255)">           sleep 10</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;line-height:normal;white-space:normal;background-color:rgb(255,255,255)">        done</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;line-height:normal;white-space:normal;background-color:rgb(255,255,255)">        sudo mount -t ext4 /dev/vdb /dev/external/</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;line-height:normal;white-space:normal;background-color:rgb(255,255,255)">        if [ $? -eq 0 ]</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;line-height:normal;white-space:normal;background-color:rgb(255,255,255)">        then</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;line-height:normal;white-space:normal;background-color:rgb(255,255,255)">          sudo echo "Already Formatted Volume. Mounted"</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;line-height:normal;white-space:normal;background-color:rgb(255,255,255)">        else</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;line-height:normal;white-space:normal;background-color:rgb(255,255,255)">          sudo /usr/sbin/mkfs.ext4 /dev/vdb</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;line-height:normal;white-space:normal;background-color:rgb(255,255,255)">          sudo mount -t ext4 /dev/vdb /dev/external/</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;line-height:normal;white-space:normal;background-color:rgb(255,255,255)">          sudo echo "RAW Volume. Formatted and mounted"</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;line-height:normal;white-space:normal;background-color:rgb(255,255,255)">        fi</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;line-height:normal;white-space:normal;background-color:rgb(255,255,255)">        sudo echo "Volume mounted"</div></pre></div><div><br></div><div>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.<br></div><div><br></div><div>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 .</div><div><br></div><div>Regards,</div><div>Vignesh Kumar Kathiresan</div><div><br></div><div><br></div><div><br></div><div><br></div></div>