-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathvm_ubuntu.arm64.yaml
More file actions
186 lines (171 loc) · 5.4 KB
/
vm_ubuntu.arm64.yaml
File metadata and controls
186 lines (171 loc) · 5.4 KB
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
tosca_definitions_version: cloudify_dsl_1_3
imports:
- http://www.getcloudify.org/spec/cloudify/4.6/types.yaml
- https://raw.githubusercontent.com/cloudify-incubator/cloudify-utilities-plugin/1.15.3/plugin.yaml
- https://raw.githubusercontent.com/cloudify-incubator/cloudify-libvirt-plugin/0.8.1/plugin.yaml
inputs:
agent_password:
default: passw0rd
agent_user:
default: ubuntu
node_templates:
common_network:
type: cloudify.libvirt.network
interfaces:
cloudify.interfaces.lifecycle:
create:
inputs:
params:
dev: virbr1
forwards:
- mode: nat
ips:
- address: 192.168.142.1
netmask: 255.255.255.0
dhcp:
start: 192.168.142.2
end: 192.168.142.254
vm_download:
type: cloudify.nodes.ApplicationServer
interfaces:
cloudify.interfaces.lifecycle:
create:
implementation: scripts/download_vm.sh
executor: central_deployment_agent
inputs:
CATALOG_URL: https://cloud-images.ubuntu.com/trusty/current
DISK: trusty-server-cloudimg-arm64-uefi1.img
cloud_init:
type: cloudify.nodes.CloudInit.CloudConfig
properties:
resource_config:
password: passw0rd
chpasswd:
expire: False
ssh_pwauth: True
common_pool:
type: cloudify.libvirt.pool
interfaces:
cloudify.interfaces.lifecycle:
create:
inputs:
params:
capacity: 80
cloudinit_volume:
type: cloudify.libvirt.volume
interfaces:
cloudify.interfaces.lifecycle:
create:
inputs:
params:
pool: { get_attribute: [common_pool, resource_id]}
capacity: 1
allocation: 1
relationships:
- target: common_pool
type: cloudify.relationships.depends_on
flash_volume:
type: cloudify.libvirt.volume
interfaces:
cloudify.interfaces.lifecycle:
create:
inputs:
params:
pool: { get_attribute: [common_pool, resource_id]}
capacity: 64
allocation: 64
relationships:
- target: common_pool
type: cloudify.relationships.depends_on
cloud_init_image:
type: cloudify.libvirt.ISO9660
interfaces:
cloudify.interfaces.lifecycle:
create:
inputs:
params:
pool: { get_attribute: [common_pool, resource_id]}
volume: { get_attribute: [cloudinit_volume, resource_id]}
files:
meta-data: >
instance-id: localhost
user-data: { get_attribute: [cloud_init, cloud_config ] }
relationships:
- target: cloud_init
type: cloudify.relationships.depends_on
- target: cloudinit_volume
type: cloudify.relationships.depends_on
disk_clone:
type: cloudify.nodes.ApplicationServer
interfaces:
cloudify.interfaces.lifecycle:
create:
implementation: scripts/disk_prepere.py
executor: central_deployment_agent
inputs:
disk_image: { get_attribute: [vm_download, vm_image] }
cloud_init: { get_attribute: [cloud_init, cloud_config ] }
configure:
implementation: scripts/copy_disk.py
executor: central_deployment_agent
delete:
implementation: scripts/remove_disk.sh
executor: central_deployment_agent
relationships:
- target: cloud_init
type: cloudify.relationships.depends_on
- target: vm_download
type: cloudify.relationships.depends_on
qemu_vm:
type: cloudify.libvirt.domain
properties:
agent_config:
install_method: none
interfaces:
cloudify.interfaces.lifecycle:
create:
inputs:
params:
memory_size: 524288
nvram: { get_attribute: [flash_volume, params, path] }
disks:
- bus: scsi
dev: sda
file: { get_attribute: [disk_clone, vm_image] }
type: qcow2
- bus: scsi
dev: sdb
file: { get_attribute: [cloudinit_volume, params, path] }
type: raw
networks:
- network: { get_attribute: [common_network, resource_id] }
dev: macvtap0
mac: 52:54:00:c0:67:81
configure:
inputs:
template_resource: templates/domain-arm.xml
relationships:
- target: common_network
type: cloudify.libvirt.relationships.connected_to
- target: disk_clone
type: cloudify.relationships.contained_in
- target: cloud_init_image
type: cloudify.relationships.depends_on
- target: flash_volume
type: cloudify.relationships.depends_on
example_node:
type: cloudify.nodes.WebServer
interfaces:
cloudify.interfaces.lifecycle:
start:
implementation: terminal.cloudify_terminal.tasks.run
inputs:
terminal_auth:
user: ubuntu
password: { get_input: agent_password }
ip: { get_attribute: [qemu_vm, ip] }
calls:
- action: uname -a
relationships:
- target: qemu_vm
type: cloudify.relationships.contained_in