Fix cloud-init insertion with v3 IM 01/5501/4
authorgcalvino <guillermo.calvinosanchez@altran.com>
Tue, 3 Oct 2017 09:31:31 +0000 (11:31 +0200)
committergcalvino <guillermo.calvinosanchez@altran.com>
Tue, 3 Oct 2017 12:19:59 +0000 (14:19 +0200)
Change-Id: Ia7657f255ff0f10d2bd1cfa934e2d15b89ef187b
Signed-off-by: gcalvino <guillermo.calvinosanchez@altran.com>
osm_ro/nfvo.py
osm_ro/vimconn.py
vnfs/examples/v3_3vdu_vnfd.yaml

index fcc7899..6ce8cd0 100644 (file)
@@ -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
index 1f6c4d1..1fbce19 100644 (file)
@@ -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
 
index 2b3470d..203f40d 100644 (file)
@@ -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
-