From: gcalvino Date: Tue, 3 Oct 2017 09:31:31 +0000 (+0200) Subject: Fix cloud-init insertion with v3 IM X-Git-Tag: v3.0.0~5 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F01%2F5501%2F4;p=osm%2FRO.git Fix cloud-init insertion with v3 IM Change-Id: Ia7657f255ff0f10d2bd1cfa934e2d15b89ef187b Signed-off-by: gcalvino --- diff --git a/osm_ro/nfvo.py b/osm_ro/nfvo.py index fcc78994..6ce8cd0e 100644 --- a/osm_ro/nfvo.py +++ b/osm_ro/nfvo.py @@ -976,7 +976,7 @@ def new_vnfd_v3(mydb, tenant_id, vnf_descriptor): "content": cfg_source}) boot_data['config-files'] = om_cfgfile_list if boot_data: - db_vm["boot_data"] = boot_data + db_vm["boot_data"] = yaml.safe_dump(boot_data, default_flow_style=True, width=256) db_vms.append(db_vm) db_vms_index += 1 diff --git a/osm_ro/vimconn.py b/osm_ro/vimconn.py index 1f6c4d1e..1fbce190 100644 --- a/osm_ro/vimconn.py +++ b/osm_ro/vimconn.py @@ -33,6 +33,7 @@ import paramiko import socket import StringIO import yaml +import sys from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText diff --git a/vnfs/examples/v3_3vdu_vnfd.yaml b/vnfs/examples/v3_3vdu_vnfd.yaml index 2b3470d6..203f40d1 100644 --- a/vnfs/examples/v3_3vdu_vnfd.yaml +++ b/vnfs/examples/v3_3vdu_vnfd.yaml @@ -25,11 +25,11 @@ vnfd:vnfd-catalog: # flavor below can fit into m1.micro vm-flavor: vcpu-count: 1 - memory-mb: 256 - storage-gb: 2 + memory-mb: 2048 + storage-gb: 20 # Image/checksum or image including the full path - image: 'cirros034' + image: 'ubuntu16.04' #checksum: interface: @@ -44,7 +44,16 @@ vnfd:vnfd-catalog: # vnfd-connection-point-ref: eth0 external-connection-point-ref: eth0 + # Replace the ssh-rsa public key to use your own public key + cloud-init: | + #cloud-config + ssh_authorized_keys: + - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDajuABKm3lzcA0hk1IQGAfSWxxE0viRedl1EnZ2s0qQL54zTGVqYzC73CndSu0az57ysAKDapKOnTWl6zfj+bU4j3c4jORDWrIelBVaeQaoWGfKtBmS7jE54I94cRgkAIk+4zM1ViRyPQ+0FoOOq7I/6rQZITZ4VqfyhygW7j2ke2vl3oJ/TKocOpdk4WlMmPC6dFYppmwlpTpPYKJVdh58aeq9G/wTRP1qvCAgZAm/1GYoj7JgQjw11j6ZZE0ci03F9aOqqMlICDJF87Zk3fUhnt+g6EYNMiEafd7kuNwXBAJ5D1n4vZnj/EpdQY+dlXhhGS2Bncr1db1YBJCoRWN Generated-by-Nova + users: + - name: osm + ssh_authorized_keys: + - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDajuABKm3lzcA0hk1IQGAfSWxxE0viRedl1EnZ2s0qQL54zTGVqYzC73CndSu0az57ysAKDapKOnTWl6zfj+bU4j3c4jORDWrIelBVaeQaoWGfKtBmS7jE54I94cRgkAIk+4zM1ViRyPQ+0FoOOq7I/6rQZITZ4VqfyhygW7j2ke2vl3oJ/TKocOpdk4WlMmPC6dFYppmwlpTpPYKJVdh58aeq9G/wTRP1qvCAgZAm/1GYoj7JgQjw11j6ZZE0ci03F9aOqqMlICDJF87Zk3fUhnt+g6EYNMiEafd7kuNwXBAJ5D1n4vZnj/EpdQY+dlXhhGS2Bncr1db1YBJCoRWN Generated-by-Nova + connection-point: - name: eth0 type: VPORT -