← Back to team overview

cloud-init-dev team mailing list archive

Re: [Merge] ~chad.smith/cloud-init:cleanup/docs-datasource-config into cloud-init:master

 

2 small things. 


Diff comments:

> diff --git a/doc/rtd/topics/datasources.rst b/doc/rtd/topics/datasources.rst
> index 38ba75d..20f7c84 100644
> --- a/doc/rtd/topics/datasources.rst
> +++ b/doc/rtd/topics/datasources.rst
> @@ -17,6 +17,103 @@ own way) internally a datasource abstract class was created to allow for a
>  single way to access the different cloud systems methods to provide this data
>  through the typical usage of subclasses.
>  
> +
> +instance-data
> +-------------
> +For reference, cloud-init stores all the metadata, vendordata and userdata
> +provided by a cloud in a json blob at ``/run/cloud-init/instance-data.json``.
> +While the json contains datasource-specific keys and names, cloud-init will
> +maintain a minimal set of standardized keys that will remain stable on any
> +cloud. Standardized instance-data keys will be present under a "v1" key.
> +Any datasource metadata cloud-init consumes will all be present under the
> +"ds" key.
> +
> +Below is an instance-data.json example from an OpenStack instance:
> +
> +.. sourcecode:: python

is there no sourcecode:: json ?

> +
> +  {
> +   "base64-encoded-keys": [
> +    "ds/meta-data/random_seed",
> +    "ds/user-data"
> +   ],
> +   "ds": {
> +    "ec2_metadata": {
> +     "ami-id": "ami-0000032f",
> +     "ami-launch-index": "0",
> +     "ami-manifest-path": "FIXME",
> +     "block-device-mapping": {
> +      "ami": "vda",
> +      "ephemeral0": "/dev/vdb",
> +      "root": "/dev/vda"
> +     },
> +     "hostname": "xenial-test.novalocal",
> +     "instance-action": "none",
> +     "instance-id": "i-0006e030",
> +     "instance-type": "m1.small",
> +     "local-hostname": "xenial-test.novalocal",
> +     "local-ipv4": "10.5.0.6",
> +     "placement": {
> +      "availability-zone": "None"
> +     },
> +     "public-hostname": "xenial-test.novalocal",
> +     "public-ipv4": "10.245.162.145",
> +     "reservation-id": "r-fxm623oa",
> +     "security-groups": "default"
> +    },
> +    "meta-data": {
> +     "availability_zone": null,
> +     "devices": [],
> +     "hostname": "xenial-test.novalocal",
> +     "instance-id": "3e39d278-0644-4728-9479-678f9212d8f0",
> +     "launch_index": 0,
> +     "local-hostname": "xenial-test.novalocal",
> +     "name": "xenial-test",
> +     "project_id": "e0eb2d2538814...",
> +     "random_seed": "A6yPN...",
> +     "uuid": "3e39d278-0644-4728-9479-678f92..."
> +    },
> +    "network_json": {
> +     "links": [
> +      {
> +       "ethernet_mac_address": "fa:16:3e:7d:74:9b",
> +       "id": "tap9ca524d5-6e",
> +       "mtu": 8958,
> +       "type": "ovs",
> +       "vif_id": "9ca524d5-6e5a-4809-936a-6901..."
> +      }
> +     ],
> +     "networks": [
> +      {
> +       "id": "network0",
> +       "link": "tap9ca524d5-6e",
> +       "network_id": "c6adfc18-9753-42eb-b3ea-18b57e6b837f",
> +       "type": "ipv4_dhcp"
> +      }
> +     ],
> +     "services": [
> +      {
> +       "address": "10.10.160.2",
> +       "type": "dns"
> +      }
> +     ]
> +    },
> +    "user-data": "I2Nsb3VkLWNvbmZpZ...",
> +    "vendor-data": null
> +   },
> +   "v1": {
> +    "availability-zone": null,
> +    "cloud-name": "openstack",
> +    "instance-id": "3e39d278-0644-4728-9479-678f9212d8f0",
> +    "local-hostname": "xenial-test",
> +    "region": null
> +   }
> +  }
> +
> +
> +
> +Datasource API
> +--------------
>  The current interface that a datasource object must provide is the following:
>  
>  .. sourcecode:: python
> diff --git a/doc/rtd/topics/datasources/openstack.rst b/doc/rtd/topics/datasources/openstack.rst
> index 43592de..0ea8994 100644
> --- a/doc/rtd/topics/datasources/openstack.rst
> +++ b/doc/rtd/topics/datasources/openstack.rst
> @@ -25,18 +25,22 @@ The settings that may be configured are:
>     the metadata service. (default: 10)
>   * **retries**: The number of retries that should be done for an http request.
>     This value is used only after metadata_url is selected. (default: 5)
> + * **apply_network_config**: A boolean specifying whether to configure the

this isn't there yet.
this hunk belongs in your other branch.
(and below).

> +   network for the instance based on network_data.json provided by the
> +   metadata service. When False, only configure dhcp on the primary nic for
> +   this instances. (default: True)
>  
> -An example configuration with the default values is provided as example below:
> +An example configuration with the default values is provided below:
>  
>  .. sourcecode:: yaml
>  
> -  #cloud-config
>    datasource:
>     OpenStack:
>      metadata_urls: ["http://169.254.169.254";]
>      max_wait: -1
>      timeout: 10
>      retries: 5
> +    apply_network_config: True
>  
>  
>  Vendor Data


-- 
https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/346657
Your team cloud-init commiters is requested to review the proposed merge of ~chad.smith/cloud-init:cleanup/docs-datasource-config into cloud-init:master.


References