You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@jclouds.apache.org by Zack Shoylev <no...@github.com> on 2014/03/01 03:04:01 UTC

[jclouds] Better documentation and a bugfix for cloud-init (#307)

You can merge this Pull Request by running:

  git pull https://github.com/rackspace/jclouds fix-nova-user-data

Or you can view, comment on it, or merge it online at:

  https://github.com/jclouds/jclouds/pull/307

-- Commit Summary --

  * Better documentation and a bugfix for cloud-init

-- File Changes --

    M apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/NovaComputeServiceAdapter.java (1)
    M apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/options/NovaTemplateOptions.java (73)
    M apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/options/CreateServerOptions.java (20)
    M apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/compute/NovaComputeServiceAdapterExpectTest.java (34)
    M apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/compute/options/NovaTemplateOptionsTest.java (2)
    A apis/openstack-nova/src/test/resources/new_server_config_drive.json (42)
    M apis/openstack-nova/src/test/resources/server_details.json (2)

-- Patch Links --

https://github.com/jclouds/jclouds/pull/307.patch
https://github.com/jclouds/jclouds/pull/307.diff

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/307

Re: [jclouds] Better documentation and a bugfix for cloud-init (#307)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-java-7-pull-requests #1098](https://jclouds.ci.cloudbees.com/job/jclouds-java-7-pull-requests/1098/) SUCCESS
This pull request looks good

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/307#issuecomment-36414275

Re: [jclouds] Better documentation and a bugfix for cloud-init (#307)

Posted by BuildHive <no...@github.com>.
[jclouds » jclouds #879](https://buildhive.cloudbees.com/job/jclouds/job/jclouds/879/) SUCCESS
This pull request looks good
[(what's this?)](https://www.cloudbees.com/what-is-buildhive)

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/307#issuecomment-36578943

Re: [jclouds] Better documentation and a bugfix for cloud-init (#307)

Posted by Zack Shoylev <no...@github.com>.
https://issues.apache.org/jira/browse/JCLOUDS-481

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/307#issuecomment-36412844

Re: [jclouds] Better documentation and a bugfix for cloud-init (#307)

Posted by Zack Shoylev <no...@github.com>.
Also this needs to be backported.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/307#issuecomment-36551884

Re: [jclouds] Better documentation and a bugfix for cloud-init (#307)

Posted by Andrew Phillips <no...@github.com>.
> @@ -290,6 +297,7 @@ public CreateServerOptions metadata(Map<String, String> metadata) {
>      * Custom user-data can be also be supplied at launch time.
>      * It is retrievable by the instance and is often used for launch-time configuration
>      * by instance scripts.
> +    * This parameter will be base64 encoded by jclouds automatically.

Something like "Pass userData unencdoed, as the value will be base64 encoded automatically"?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/307/files#r10191665

Re: [jclouds] Better documentation and a bugfix for cloud-init (#307)

Posted by Andrew Phillips <no...@github.com>.
> jclouds » jclouds #877 UNSTABLE

Unrelated [test failure](https://buildhive.cloudbees.com/job/jclouds/job/jclouds/org.apache.jclouds$jclouds-core/877/testReport/junit/org.jclouds.rest.functions/PresentWhenApiVersionLexicographicallyAtOrAfterSinceApiVersionTest/testCacheIsFasterWhenAnnotationPresent/)

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/307#issuecomment-36550995

Re: [jclouds] Better documentation and a bugfix for cloud-init (#307)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-pull-requests #628](https://jclouds.ci.cloudbees.com/job/jclouds-pull-requests/628/) SUCCESS
This pull request looks good

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/307#issuecomment-36414126

Re: [jclouds] Better documentation and a bugfix for cloud-init (#307)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-java-7-pull-requests #1099](https://jclouds.ci.cloudbees.com/job/jclouds-java-7-pull-requests/1099/) UNSTABLE
Looks like there's a problem with this pull request

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/307#issuecomment-36552436

Re: [jclouds] Better documentation and a bugfix for cloud-init (#307)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-java-7-pull-requests #1101](https://jclouds.ci.cloudbees.com/job/jclouds-java-7-pull-requests/1101/) SUCCESS
This pull request looks good

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/307#issuecomment-36578148

Re: [jclouds] Better documentation and a bugfix for cloud-init (#307)

Posted by Andrew Phillips <no...@github.com>.
+1 - looks good to me. Thanks, @zack-shoylev!

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/307#issuecomment-36664245

Re: [jclouds] Better documentation and a bugfix for cloud-init (#307)

Posted by BuildHive <no...@github.com>.
[jclouds » jclouds #877](https://buildhive.cloudbees.com/job/jclouds/job/jclouds/877/) UNSTABLE
Looks like there's a problem with this pull request
[(what's this?)](https://www.cloudbees.com/what-is-buildhive)

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/307#issuecomment-36550437

Re: [jclouds] Better documentation and a bugfix for cloud-init (#307)

Posted by Andrew Phillips <no...@github.com>.
Thanks also for the style cleanup. Why is this a bugfix, by the way? Looks like new functionality?

Not that that matters, just out of curiosity...

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/307#issuecomment-36430950

Re: [jclouds] Better documentation and a bugfix for cloud-init (#307)

Posted by Zack Shoylev <no...@github.com>.
> @@ -297,6 +305,14 @@ public CreateServerOptions userData(byte[] userData) {
>     }
>  
>     /**
> +    * This needs to be set to "true" when trying to use user data for cloud-init.

Good point, I will have to look into that. Not completely sure how user-data is used by itself.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/307/files#r10215620

Re: [jclouds] Better documentation and a bugfix for cloud-init (#307)

Posted by BuildHive <no...@github.com>.
[jclouds » jclouds #876](https://buildhive.cloudbees.com/job/jclouds/job/jclouds/876/) SUCCESS
This pull request looks good
[(what's this?)](https://www.cloudbees.com/what-is-buildhive)

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/307#issuecomment-36414112

Re: [jclouds] Better documentation and a bugfix for cloud-init (#307)

Posted by Zack Shoylev <no...@github.com>.
Getting ready to merge, then work on backport.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/307#issuecomment-36572915

Re: [jclouds] Better documentation and a bugfix for cloud-init (#307)

Posted by Andrew Phillips <no...@github.com>.
> @@ -297,6 +305,14 @@ public CreateServerOptions userData(byte[] userData) {
>     }
>  
>     /**
> +    * This needs to be set to "true" when trying to use user data for cloud-init.

Document the base case as well as the "exceptional" (cloud-init) case? Something like: "Set to true to use a config drive for metadata. Needs to be set to true when working with user data for cloud-init"?



---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/307/files#r10191679

Re: [jclouds] Better documentation and a bugfix for cloud-init (#307)

Posted by Andrew Phillips <no...@github.com>.
> jclouds-java-7-pull-requests #1099 UNSTABLE

Another unrelated [test failure](https://jclouds.ci.cloudbees.com/job/jclouds-java-7-pull-requests/org.apache.jclouds$jclouds-compute/1099/testReport/junit/org.jclouds.compute.callables/BlockUntilInitScriptStatusIsZeroThenReturnOutputTest/testloopUntilTrueOrThrowCancellationExceptionReturnsWhenPredicateIsTrueSecondTimeWhileNotCancelled/)

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/307#issuecomment-36555367

Re: [jclouds] Better documentation and a bugfix for cloud-init (#307)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-pull-requests #631](https://jclouds.ci.cloudbees.com/job/jclouds-pull-requests/631/) SUCCESS
This pull request looks good

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/307#issuecomment-36577622

Re: [jclouds] Better documentation and a bugfix for cloud-init (#307)

Posted by Andrew Phillips <no...@github.com>.
> @@ -541,5 +561,18 @@ public NovaTemplateOptions userData(byte[] userData) {
>     public NovaTemplateOptions diskConfig(String diskConfig) {
>        this.diskConfig = diskConfig;
>        return this;
> -  }
> +   }
> +
> +   /**
> +    * OpenStack can be configured to write metadata to a special configuration drive that will be 
> +    * attached to the instance when it boots. The instance can retrieve any information that would 
> +    * normally be available through the metadata service by mounting this disk and reading files from it.
> +    * To enable the config drive, set this parameter to "true".
> +    * This has to be enabled for user data cases.
> +    * @see CreateServerOptions#getConfigDrive()
> +    */
> +   public NovaTemplateOptions configDrive(boolean configDrive) {

> In nova it's called "config_drive"

OK, then let's keep it as-is...

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/307/files#r10216725

Re: [jclouds] Better documentation and a bugfix for cloud-init (#307)

Posted by Zack Shoylev <no...@github.com>.
> @@ -541,5 +561,18 @@ public NovaTemplateOptions userData(byte[] userData) {
>     public NovaTemplateOptions diskConfig(String diskConfig) {
>        this.diskConfig = diskConfig;
>        return this;
> -  }
> +   }
> +
> +   /**
> +    * OpenStack can be configured to write metadata to a special configuration drive that will be 
> +    * attached to the instance when it boots. The instance can retrieve any information that would 
> +    * normally be available through the metadata service by mounting this disk and reading files from it.
> +    * To enable the config drive, set this parameter to "true".
> +    * This has to be enabled for user data cases.
> +    * @see CreateServerOptions#getConfigDrive()
> +    */
> +   public NovaTemplateOptions configDrive(boolean configDrive) {

In nova it's called "config_drive". I think it makes sense to keep it aligned, even though it is boolean-ish?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/307/files#r10216170

Re: [jclouds] Better documentation and a bugfix for cloud-init (#307)

Posted by Zack Shoylev <no...@github.com>.
I guess you are right. It is really adding support for previously missing functionality.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/307#issuecomment-36524896

Re: [jclouds] Better documentation and a bugfix for cloud-init (#307)

Posted by Zack Shoylev <no...@github.com>.
Closed #307.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/307

Re: [jclouds] Better documentation and a bugfix for cloud-init (#307)

Posted by Andrew Phillips <no...@github.com>.
> @@ -541,5 +561,18 @@ public NovaTemplateOptions userData(byte[] userData) {
>     public NovaTemplateOptions diskConfig(String diskConfig) {
>        this.diskConfig = diskConfig;
>        return this;
> -  }
> +   }
> +
> +   /**
> +    * OpenStack can be configured to write metadata to a special configuration drive that will be 
> +    * attached to the instance when it boots. The instance can retrieve any information that would 
> +    * normally be available through the metadata service by mounting this disk and reading files from it.
> +    * To enable the config drive, set this parameter to "true".
> +    * This has to be enabled for user data cases.
> +    * @see CreateServerOptions#getConfigDrive()
> +    */
> +   public NovaTemplateOptions configDrive(boolean configDrive) {

I guess this property name is aligned with the OpenStack option? Otherwise, would "useConfigDrive" make more sense? On seeing the property for the first time, I assumed it would represent some kind of drive object...

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/307/files#r10191655

Re: [jclouds] Better documentation and a bugfix for cloud-init (#307)

Posted by Zack Shoylev <no...@github.com>.
> @@ -290,6 +297,7 @@ public CreateServerOptions metadata(Map<String, String> metadata) {
>      * Custom user-data can be also be supplied at launch time.
>      * It is retrievable by the instance and is often used for launch-time configuration
>      * by instance scripts.
> +    * This parameter will be base64 encoded by jclouds automatically.

Nice.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/307/files#r10216209

Re: [jclouds] Better documentation and a bugfix for cloud-init (#307)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-pull-requests #629](https://jclouds.ci.cloudbees.com/job/jclouds-pull-requests/629/) SUCCESS
This pull request looks good

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/307#issuecomment-36551978