use of org.jclouds.openstack.cinder.v1.options.CreateVolumeOptions in project legacy-jclouds-examples by jclouds.
the class CreateVolumeAndAttach method createVolume.
private Volume createVolume() throws TimeoutException {
CreateVolumeOptions options = CreateVolumeOptions.Builder.name(Constants.NAME).metadata(ImmutableMap.<String, String>of("key1", "value1"));
System.out.println("Create Volume");
// 100 GB is the minimum volume size on the Rackspace Cloud
Volume volume = volumeApi.create(100, options);
// /jclouds-example/rackspace/src/main/java/org/jclouds/examples/rackspace/Logging.java
if (!VolumePredicates.awaitAvailable(volumeApi).apply(volume)) {
throw new TimeoutException("Timeout on volume: " + volume);
}
System.out.println(" " + volume);
return volume;
}
Aggregations