This was discussed on the IRC, but let's make sure the thread gets answered.
Currently there is no way to do that using the ComputeService, but the
GCE provider specific API supports it. The InstanceApi [1] has the
"create" and "attachDisk" method, that can be used to create instances
with custom disks and attach disks to existing ones.
The former gets a NewInstance object that has a list of AttachDisk
objects. There you cans et the size of the disk and their type. The
same applies to the "attachDisk" method, thich gets an AttachDisk
object. Using those methods you should be able to create instances
with custom disks.
If you have the ComputeServiceContext instance, you can get the
InstanceApi as follows:
GoogleComputeEngineApi gce = context.unwrapApi(GoogleComputeEngineApi.class);
InstanceApi instanceApi = gce.instancesInZone("zone name");
HTH!
I.
[1]
https://github.com/jclouds/jclouds-labs-google/blob/master/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/InstanceApi.java
On 16 February 2015 at 04:49, Ruben Rubio Rey <[email protected]> wrote:
> Hi,
>
> I am not able to find any sample in Internet. GCE has Standard Disk and SSD
> disks. I have a few questions.
>
> - When you are creating an instance, how can you choose SSD instead
> Standard Disk ?
> - How can you customize the size of the root volume ?
> - How can you add additional volumes ?
>
> I hope someone can point me into the right direction.
>
> Regards,
> Ruben