Cloud 如何在openstack创建实例中指定磁盘大小

Cloud 如何在openstack创建实例中指定磁盘大小,cloud,openstack,jclouds,Cloud,Openstack,Jclouds,我在openstack中使用下面的代码创建实例,它将使用openstack风格列表来获取硬件细节。是否存在使用computeService API显式传递磁盘大小的方法 ComputeServiceContext computeContext = ContextBuilder.newBuilder(credentials.getProviderName()) .endpoint(credentials.getResourceEndPoint())

我在openstack中使用下面的代码创建实例,它将使用openstack风格列表来获取硬件细节。是否存在使用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);
ComputeServiceContext computeContext=ContextBuilder.newBuilder(credentials.getProviderName())
.endpoint(凭据.getResourceEndPoint())
.凭证(信用证、通行证)
.modules(ImmutableSet.of(新的SSHJSHClientModule())
.覆盖(OpenStackProperties)
.buildView(ComputeServiceContext.class);
templateBuilder.imageId(instance.getImageId());
templateBuilder.hardwareId(instance.getInstanceType());
options.as(NovaTemplateOptions.class).nodeNames(
新建ArrayList(Arrays.asList(实例
.getInstanceName());
options.as(NovaTemplateOptions.class).networks(
实例。getNetworkType());
templateBuilder.locationId(“RegionOne”);
build=templateBuilder.build();

SetTemplateBuilder有一个minDisk(双千兆字节)选项,可用于提供最小磁盘大小


你们有与minDisk尺寸相匹配的nova口味吗?我认为if应该使用该变量过滤口味列表。有一件事可以帮助确定发生了什么,那就是启用线级日志记录(按照),查看nova口味列表以及在create调用中选择的口味。