Dear all,
I'm using JClouds to starting and configure a EC2 cluster. My idea is to start a instance, attach a volume that I've created previously, and mount the attach volume.
So I'm doing something like this
:
Attachment attachment = ebsClient.attachVolumeInRegion(regionId, volumeId, nodeId, "/dev/sdh")
RunScriptOptions opt = new RunScriptOptions().runAsRoot(true)
def mountScript = "mkdir -p /data; mount /dev/sdh /data "
compute.runScriptOnNode(nodeId, mountScript, opt)
But when I login in the instance the volume is attached but NOT mounted and I have to do it manually.
I'm supposing that I need to monitor the Attachment status waiting the volume to be in the ATTACHED status.
To do that would be enough something like this:
while( attachment.getStatus() != Status.ATTACHED ) {
sleep( 30 000 )
}
or it is required to query explicitly for the volume attachment status using the describeVolumesInRegion() api ?
Any other suggestions is welcome.
Thank you,
Paolo