> + this.diskMode = diskMode;
> + this.isBootDisk = isBootDisk;
> + this.diskSizeGb = diskSizeGb;
> + }
> +
> + public AutoCreateDiskOptions(final AttachDisk.Type diskType, final
> AttachDisk.Mode diskMode, final boolean isBootDisk, final int diskSizeGb,
> final String diskName) {
> + this(diskType, diskMode, isBootDisk, diskSizeGb);
> + // TODO: Validate against regex according to GCE spec.
> + this.diskName = diskName;
> + }
> +
> + public String getDiskName(final String nodeName) {
> + if (null != diskName)
> + return diskName;
> + else
> + return "jclouds-" + UUID.randomUUID().toString();
Hi Dan
It’s not necessary, but it would be nice.
Problem is, it’s impossible without changing stuff in the generic API.
Today, there’s an API to supply node names in the portable api’s
templateOptions, and then create multiple nodes with a single call. Say for
example, I set nodeNames to “node1,node2,node3” and then create 3 nodes using
the same templateOptions, the nodes will be called node1..3.
To have the disk names include the node names (BTW, not always possible - in
GCE disk name is governed by a regex) would require significant changes (I
haven’t done a full feasibility research though).
(Y)
> On Apr 13, 2015, at 8:00 AM, danbroudy <[email protected]> wrote:
>
> In
> google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/options/GoogleComputeEngineTemplateOptions.java
>
> <https://github.com/jclouds/jclouds-labs-google/pull/135#discussion_r28214469>:
>
> > + this.diskMode = diskMode;
> > + this.isBootDisk = isBootDisk;
> > + this.diskSizeGb = diskSizeGb;
> > + }
> > +
> > + public AutoCreateDiskOptions(final AttachDisk.Type diskType, final
> > AttachDisk.Mode diskMode, final boolean isBootDisk, final int diskSizeGb,
> > final String diskName) {
> > + this(diskType, diskMode, isBootDisk, diskSizeGb);
> > + // TODO: Validate against regex according to GCE spec.
> > + this.diskName = diskName;
> > + }
> > +
> > + public String getDiskName(final String nodeName) {
> > + if (null != diskName)
> > + return diskName;
> > + else
> > + return "jclouds-" + UUID.randomUUID().toString();
> Do you think it makes sense to include some aspect of the nodeName in the
> diskName? I am still figuring out the jclouds resource naming
> conventions/scheme.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/jclouds/jclouds-labs-google/pull/135/files#r28214469>.
>
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/135/files#r28250783