I'm using the below code in openstack for create instance which will use openstack flavor list to get the hardware details. Is there any was to pass the disk size explicitly using computeService API ?
ComputeServiceContext computeContext = ContextBuilder.newBuilder(credentials.getProviderName())
.endpoint(credentials.getResourceEndPoint())
.credentials(cred, passwd)
.modules(ImmutableSet.<Module> of(new SshjSshClientModule()))
.overrides(openStackPropeties)
.buildView(ComputeServiceContext.class);
templateBuilder.imageId(instance.getImageId());
templateBuilder.hardwareId(instance.getInstanceType());
options.as(NovaTemplateOptions.class).nodeNames(
new ArrayList<String>(Arrays.asList(instance
.getInstanceName())));
options.as(NovaTemplateOptions.class).networks(
instance.getNetworkType());
templateBuilder.locationId("RegionOne");
build = templateBuilder.build();
Set<? extends NodeMetadata> nodeMetadatas = computeService.createNodesInGroup("securitygroup.name",
instanceCount, build);