Skip to content

Instantly share code, notes, and snippets.

@nacx
Created June 28, 2011 13:59
Show Gist options
  • Save nacx/1051183 to your computer and use it in GitHub Desktop.
Save nacx/1051183 to your computer and use it in GitHub Desktop.
Massive volume creation in Abiquo
#!/bin/bash
NUM=20 # The number of volumes to create
DC=2 # The datacenter where the volumes will be created
TIER=1 # The tier where the volumes will be created
VDC=4 # The virtual datacenter where the volumes will be created
SIZE=100 # The size of the volumes to create in MB
LOGIN=admin:xabiquo # The credentials
for V in `seq 1 ${NUM}`; do
curl "http://localhost/api/cloud/virtualdatacenters/${VDC}/volumes" \
-X POST -u ${LOGIN} -H "Content-type: application/xml" \
-d "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>
<volume>
<link href=\"http://localhost/api/admin/datacenters/${DC}/storage/tiers/${TIER}\" rel=\"tier\" title=\"Tier\"/>
<name>Volume ${V}</name>
<sizeInMB>${SIZE}</sizeInMB>
</volume>" | xmlindent -nbe -f
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment