else:
av_index = None
for vm_index in range(0, vm.get('count', 1)):
+ if vm.get("instance_parameters") and vm["instance_parameters"].get("cloud_init"):
+ cloud_config_vm_ = unify_cloud_config(cloud_config_vm,
+ {"user-data": vm["instance_parameters"]["cloud_init"][vm_index]})
+
vm_name = myVMDict['name'] + "-" + str(vm_index+1)
vm_networks = deepcopy(myVMDict['networks'])
task_params = (vm_name, myVMDict['description'], myVMDict.get('start', None),
- myVMDict['imageRef'], myVMDict['flavorRef'], vm_networks, cloud_config_vm,
+ myVMDict['imageRef'], myVMDict['flavorRef'], vm_networks, cloud_config_vm_,
myVMDict['disks'], av_index, vnf_availability_zones)
vm_uuid = str(uuid4())
db_vim_actions.append({"TO-UPDATE": {}, "WHERE": {
"item": "instance_wim_nets", "item_id": db_vm_iface["instance_wim_net_id"]}})
task_params_copy = deepcopy(task_params)
+ cloud_config_vm = task_params_copy[6] or {}
+ cloud_config_vm.pop("user-data", None)
+ if vdu.get("cloud_init"):
+ cloud_config_vm_ = unify_cloud_config(cloud_config_vm, {"user-data": vdu["cloud_init"][index]})
+ task_params_copy[6] = cloud_config_vm_
for iface in task_params_copy[5]:
iface["uuid"] = iface2iface[iface["uuid"]]
# increment ip_address
object_schema={"type":"object"}
schema_version_2={"type":"integer","minimum":2,"maximum":2}
#schema_version_string={"type":"string","enum": ["0.1", "2", "0.2", "3", "0.3"]}
+string_list = {"type": "array", "items": {"type": "string"}}
log_level_schema={"type":"string", "enum":["DEBUG", "INFO", "WARNING","ERROR","CRITICAL"]}
checksum_schema={"type":"string", "pattern":"^[0-9a-fA-F]{32}$"}
size_schema={"type":"integer","minimum":1,"maximum":100}
"type": "object",
"properties": {
"name": name_schema, # overrides vdu name schema
- "mgmt_keys": {"type": "array", "items": {"type": "string"}},
+ "mgmt_keys": string_list,
"vduImage": name_schema,
+ "cloud_init": string_list,
"devices": {
"type": "object",
"patternProperties": {
"osm_vdu_id": name_schema,
"member-vnf-index": name_schema,
"count": integer1_schema,
- "type": {"enum": ["create", "delete"]}
+ "type": {"enum": ["create", "delete"]},
+ "cloud_init": string_list,
},
"additionalProperties": False,
"minProperties": 1,