Revert "Full Juju Charm support"
[osm/SO.git] / designs / cloud-init-support.md
1 # [Cloud-init Support](https://osm.etsi.org/gerrit/#/c/168/) #
2
3 ## Purpose ##
4 This document describes the functional specification for the
5 cloud-init support feature within the SO Module.
6
7 ## Impacted Modules ##
8 SO, RO, VCA
9
10 ## Data Model Changes ##
11 The network service descriptor will allow the ability to specify ssh-keys and users,
12
13 container nsd-catalog {
14   container nsd {
15     list key-pair {
16       key "name";
17       description "Used to configure the list of public keys to be injected as part
18                    of ns instantiation";
19       leaf name {
20         description "Name of this key pair";
21         type string;
22       }
23
24       leaf key {
25         description "Key associated with this key pair";
26         type string;
27       }
28     }
29     list user {
30       key "name";
31
32       description "List of users to be added through cloud-config";
33       leaf name {
34         description "Name of the user ";
35         type string;
36       }
37       leaf user-info {
38         description "The user name's real name";
39         type string;
40       }
41       leaf passwd {
42         description "The user password";
43         type string;
44       }
45     }
46   }
47 }
48
49 The ns-instance-config node will be modified to add  the following grouping,
50
51   grouping cloud-config {
52     description "List of cloud config parameters";
53
54     list ssh-authorized-key {
55       key "key-pair-ref";
56
57       description "List of authorized ssh keys as part of cloud-config";
58
59       leaf key-pair-ref {
60         description "A reference to the key pair entry in the global key pair table";
61         type leafref {
62           path "/nsr:key-pair/nsr:name";
63         }
64       }
65     }
66     list user {
67       key "name";
68
69       description "List of users to be added through cloud-config";
70       leaf name {
71         description "Name of the user ";
72         type string;
73       }
74       leaf user-info {
75         description "The user name's real name";
76         type string;
77       }
78       leaf passwd {
79         description "The user password";
80         type string;
81       }
82     }
83   }
84
85
86 A top level node will be introduced in nsr data model that includes the ssh keys. The cloud-config
87 will  refer to the key-pairs in this list.
88
89   list key-pair {
90     key "name";
91     description "Used to configure the list of public keys to be injected as part
92                  of ns instantiation";
93     leaf name {
94       description "Name of this key pair";
95       type string;
96     }
97
98     leaf key {
99       description "Key associated with this key pair";
100       type string;
101     }
102   }
103
104
105 ## Overview ##
106 This cloud-init support will add the ability to declaratively specify authorized
107 ssh keys(user specified and OSM generated) and user name/passwords through cloud-init.
108
109 ## Feature description ##
110 Release1 will provide the ability to declaratively specify a list of  authorized
111 ssh keys and user-name/passwords at the time of Instantiation or in the NS descriptor
112 which will be passed from UI to SO to RO.
113
114 If the keys/user are specified in descriptor, and if they are specified at the time of instantiation
115 they will be merged  and used for instantiation.
116
117 In addition to the user-specified ssh-keys the SO will also generate an
118 additional "osm ssh keys" which will passed to both RO and VCA.
119
120
121 ## Inter-Module Dependencies ##
122 The RO Module Northbound APIs  need to be enhanced to be able to pass user_data argument and osm key.
123 SO need to pass the generated OSM keys VCA.
124
125 ## Risks ##
126 No significant risks other than the inter-module dependencies.
127
128 ## Assumptions ##
129
130  - It is assumed that the support for the cloud-init is limited to user-name/password
131    and ssh-keys at the NS level and that the same set of keys will be included in all the
132    VDUs and all VNFs within the NS. Additional parameters will be added on a need-basis in
133    future releases
134  - There will not be support to add these keys/user a the VNF level
135    The keys/users will be taken as an input at the time of instantiation.
136  - Will maintain the support for user-data at the VDU level - If the user-data
137    is specified at the VDU level, the inputs from the NS instantiation will be merged
138    to the VDU level for  each VDU in the NS.
139 - There will not be support for these scripts in the NSD.
140   It will be handled as an input in ns-instance-config as part of the parameters during instantiation.