blob: 102c3dd75a8d3d8c9d7b9e4baf51107014e95153 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
|
# Documentation on data sources configuration options
datasource:
# Ec2
Ec2:
# timeout: the timeout value for a request at metadata service
timeout : 50
# The length in seconds to wait before giving up on the metadata
# service. The actual total wait could be up to
# len(resolvable_metadata_urls)*timeout
max_wait : 120
#metadata_url: a list of URLs to check for metadata services
metadata_urls:
- http://169.254.169.254:80
- http://instance-data:8773
AltCloud:
Data souce AltCloud will be used to pick up user data on
RHEVm and vSphere.
RHEVm:
======
For REHVm v3.0 the userdata is injected into the VM using floppy
injection via the RHEVm dashboard "Custom Properties". The format
of the Custom Properties entry must be:
"floppyinject=user-data.txt:<base64 encoded data>"
e.g.: To pass a simple bash script
% cat simple_script.bash
#!/bin/bash
echo "Hello Joe!" >> /tmp/JJV_Joe_out.txt
% cat simple_script.bash | base64
IyEvYmluL2Jhc2gKZWNobyAiSGVsbG8gSm9lISIgPj4gL3RtcC9KSlZfSm9lX291dC50eHQK
To pass this example script to cloud-init running in a RHEVm v3.0 VM
set the "Custom Properties" when creating the RHEMv v3.0 VM to:
floppyinject=user-data.txt:IyEvYmluL2Jhc2gKZWNobyAiSGVsbG8gSm9lISIgPj4gL3RtcC9KSlZfSm9lX291dC50eHQK
NOTE: The prefix with file name must be: "floppyinject=user-data.txt:"
It is also possible to launch a RHEVm v3.0 VM and pass optional user
data to it using the Delta Cloud.
For more inforation on Delta Cloud see: http://deltacloud.apache.org
vSphere:
========
For VMWare's vSphere the userdata is injected into the VM an ISO
via the cdrom. This can be done using the vSphere dashboard
by connecting an ISO image to the CD/DVD drive.
To pass this example script to cloud-init running in a vSphere VM
set the CD/DVD drive when creating the vSphere VM to point to an
ISO on the data store.
The ISO must contain the user data:
For example, to pass the same simple_script.bash to vSphere:
Create the ISO:
===============
% mkdir my-iso
NOTE: The file name on the ISO must be: "user-data.txt"
% cp simple_scirpt.bash my-iso/user-data.txt
% genisoimage -o user-data.iso -r my-iso
Verify the ISO:
===============
% sudo mkdir /media/vsphere_iso
% sudo mount -o loop JoeV_CI_02.iso /media/vsphere_iso
% cat /media/vsphere_iso/user-data.txt
% sudo umount /media/vsphere_iso
Then, launch the vSphere VM the ISO user-data.iso attached as a CDrom.
It is also possible to launch a vSphere VM and pass optional user
data to it using the Delta Cloud.
For more inforation on Delta Cloud see: http://deltacloud.apache.org
MAAS:
timeout : 50
max_wait : 120
# there are no default values for metadata_url or oauth credentials
# If no credentials are present, non-authed attempts will be made.
metadata_url: http://mass-host.localdomain/source
consumer_key: Xh234sdkljf
token_key: kjfhgb3n
token_secret: 24uysdfx1w4
NoCloud:
# default seedfrom is None
# if found, then it should contain a url with:
# <url>/user-data and <url>/meta-data
# seedfrom: http://my.example.com/i-abcde
seedfrom: None
|