Browse Source

Merge "Standard Controller Configurations"

Zuul 2 months ago
parent
commit
e149c057e0

+ 6
- 1
deployment/README.rst View File

@@ -80,6 +80,7 @@ identity:
80 80
 - Controller All-in-one
81 81
 - Controller
82 82
 - Compute
83
+- Storage
83 84
 
84 85
 These nodes are used to create the virtual machines and the network interfaces
85 86
 to setup the StarlingX system:
@@ -88,9 +89,13 @@ to setup the StarlingX system:
88 89
   - 1 Controller
89 90
 - Setup Duplex
90 91
   - 2 Controllers
91
-- Setup Standard Controller
92
+- Setup Controller Storage
93
+  - 2 Controllers
94
+  - 2 Computes
95
+- Setup Dedicated Storage
92 96
   - 2 Controllers
93 97
   - 2 Computes
98
+  - 2 Storages
94 99
 
95 100
 Directory: virtualbox
96 101
 ~~~~~~~~~~~~~~~~~~~~~

+ 2
- 1
deployment/libvirt/README.rst View File

@@ -50,7 +50,8 @@ builds different StarlingX cloud configurations:
50 50
 
51 51
 - simplex
52 52
 - duplex
53
-- standardcontroller
53
+- controllerstorage
54
+- dedicatedstorage
54 55
 
55 56
 You need an StarlingX ISO file for the installation. The script takes the
56 57
 configuration name with the ``-c`` option and the ISO file name with the

+ 11
- 2
deployment/libvirt/destroy_configuration.sh View File

@@ -30,11 +30,20 @@ DOMAIN_DIRECTORY=vms
30 30
 
31 31
 destroy_controller ${CONFIGURATION} ${CONTROLLER}
32 32
 
33
-if ([ "$CONFIGURATION" == "standardcontroller" ]); then
33
+if ([ "$CONFIGURATION" == "controllerstorage" ] || [ "$CONFIGURATION" == "dedicatedstorage" ]); then
34 34
     COMPUTE=${COMPUTE:-compute}
35 35
     COMPUTE_NODES_NUMBER=${COMPUTE_NODES_NUMBER:-1}
36 36
     for ((i=0; i<=$COMPUTE_NODES_NUMBER; i++)); do
37 37
         COMPUTE_NODE=${CONFIGURATION}-${COMPUTE}-${i}
38
-        destroy_compute $COMPUTE_NODE
38
+        destroy_node "compute" $COMPUTE_NODE
39
+    done
40
+fi
41
+
42
+if ([ "$CONFIGURATION" == "dedicatedstorage" ]); then
43
+    STORAGE=${STORAGE:-storage}
44
+    STORAGE_NODES_NUMBER=${STORAGE_NODES_NUMBER:-1}
45
+    for ((i=0; i<=$STORAGE_NODES_NUMBER; i++)); do
46
+        STORAGE_NODE=${CONFIGURATION}-${STORAGE}-${i}
47
+        destroy_node "storage" ${STORAGE_NODE}
39 48
     done
40 49
 fi

+ 27
- 24
deployment/libvirt/functions.sh View File

@@ -4,7 +4,7 @@ usage() {
4 4
     echo "$0 [-h] [-c <configuration>] [-i <iso image>]"
5 5
     echo ""
6 6
     echo "Options:"
7
-    echo "  -c: Configuration: simplex, duplex, standardcontroller"
7
+    echo "  -c: Configuration: simplex, duplex, controllerstorage, dedicatedstorage"
8 8
     echo "  -i: StarlingX ISO image"
9 9
     echo ""
10 10
 }
@@ -13,7 +13,7 @@ usage_destroy() {
13 13
     echo "$0 [-h] [-c <configuration>]"
14 14
     echo ""
15 15
     echo "Options:"
16
-    echo "  -c: Configuration: simplex, duplex, standardcontroller"
16
+    echo "  -c: Configuration: simplex, duplex, controllerstorage, dedicatedstorage"
17 17
     echo ""
18 18
 }
19 19
 
@@ -27,9 +27,9 @@ iso_image_check() {
27 27
 
28 28
 configuration_check() {
29 29
     local CONFIGURATION=$1
30
-    if [ $CONFIGURATION != "simplex" ] && [ $CONFIGURATION != "duplex" ] && [ $CONFIGURATION != "standardcontroller" ]; then
30
+    if [ $CONFIGURATION != "simplex" ] && [ $CONFIGURATION != "duplex" ] && [ $CONFIGURATION != "controllerstorage" ] && [ $CONFIGURATION != "dedicatedstorage" ]; then
31 31
         echo "Please check your configuration name, available configurations:"
32
-        echo "simplex, duplex, standardcontroller"
32
+        echo "simplex, duplex, controllerstorage, dedicatedstorage"
33 33
         exit 1
34 34
     fi
35 35
 }
@@ -150,17 +150,19 @@ destroy_controller() {
150 150
     done
151 151
 }
152 152
 
153
-# Create a Compute node
154
-create_compute() {
155
-    local COMPUTE_NODE=$1
156
-    local DOMAIN_FILE=${DOMAIN_DIRECTORY}/${COMPUTE_NODE}.xml
157
-    sudo qemu-img create -f qcow2 /var/lib/libvirt/images/${COMPUTE_NODE}-0.img 200G
158
-    sudo qemu-img create -f qcow2 /var/lib/libvirt/images/${COMPUTE_NODE}-1.img 200G
159
-    cp compute.xml ${DOMAIN_FILE}
153
+# Create a Node
154
+create_node() {
155
+    local IDENTITY=$1
156
+    local NODE=$2
157
+    local BRIDGE_INTERFACE=$3
158
+    local DOMAIN_FILE=${DOMAIN_DIRECTORY}/${NODE}.xml
159
+    sudo qemu-img create -f qcow2 /var/lib/libvirt/images/${NODE}-0.img 200G
160
+    sudo qemu-img create -f qcow2 /var/lib/libvirt/images/${NODE}-1.img 200G
161
+    cp ${IDENTITY}.xml ${DOMAIN_FILE}
160 162
     sed -i -e "
161
-        s,NAME,${COMPUTE_NODE},;
162
-        s,DISK0,/var/lib/libvirt/images/${COMPUTE_NODE}-0.img,;
163
-        s,DISK1,/var/lib/libvirt/images/${COMPUTE_NODE}-1.img,
163
+        s,NAME,${NODE},;
164
+        s,DISK0,/var/lib/libvirt/images/${NODE}-0.img,;
165
+        s,DISK1,/var/lib/libvirt/images/${NODE}-1.img,
164 166
         s,%BR1%,${BRIDGE_INTERFACE}1,
165 167
         s,%BR2%,${BRIDGE_INTERFACE}2,
166 168
         s,%BR3%,${BRIDGE_INTERFACE}3,
@@ -169,19 +171,20 @@ create_compute() {
169 171
     sudo virsh define ${DOMAIN_FILE}
170 172
 }
171 173
 
172
-# Delete a Compute node
173
-destroy_compute() {
174
-    local COMPUTE_NODE=$1
175
-    local DOMAIN_FILE=$DOMAIN_DIRECTORY/$COMPUTE_NODE.xml
176
-    if virsh list --all --name | grep ${COMPUTE_NODE}; then
177
-        STATUS=$(virsh list --all | grep ${COMPUTE_NODE} | awk '{ print $3}')
174
+# Delete a Node
175
+destroy_node() {
176
+    local IDENTITY=$1
177
+    local NODE=$2
178
+    local DOMAIN_FILE=$DOMAIN_DIRECTORY/$NODE.xml
179
+    if virsh list --all --name | grep ${NODE}; then
180
+        STATUS=$(virsh list --all | grep ${NODE} | awk '{ print $3}')
178 181
         if ([ "$STATUS" == "running" ])
179 182
         then
180
-            sudo virsh destroy ${COMPUTE_NODE}
183
+            sudo virsh destroy ${NODE}
181 184
         fi
182
-        sudo virsh undefine ${COMPUTE_NODE}
183
-        delete_disk /var/lib/libvirt/images/${COMPUTE_NODE}-0.img
184
-        delete_disk /var/lib/libvirt/images/${COMPUTE_NODE}-1.img
185
+        sudo virsh undefine ${NODE}
186
+        delete_disk /var/lib/libvirt/images/${NODE}-0.img
187
+        delete_disk /var/lib/libvirt/images/${NODE}-1.img
185 188
         [ -e ${DOMAIN_FILE} ] && delete_xml ${DOMAIN_FILE}
186 189
     fi
187 190
 }

+ 11
- 2
deployment/libvirt/setup_configuration.sh View File

@@ -32,6 +32,8 @@ BRIDGE_INTERFACE=${BRIDGE_INTERFACE:-stxbr}
32 32
 CONTROLLER=${CONTROLLER:-controller}
33 33
 COMPUTE=${COMPUTE:-compute}
34 34
 COMPUTE_NODES_NUMBER=${COMPUTE_NODES_NUMBER:-1}
35
+STORAGE=${STORAGE:-storage}
36
+STORAGE_NODES_NUMBER=${STORAGE_NODES_NUMBER:-1}
35 37
 DOMAIN_DIRECTORY=vms
36 38
 
37 39
 bash ${SCRIPT_DIR}/destroy_configuration.sh -c $CONFIGURATION
@@ -40,10 +42,17 @@ bash ${SCRIPT_DIR}/destroy_configuration.sh -c $CONFIGURATION
40 42
 
41 43
 create_controller $CONFIGURATION $CONTROLLER $BRIDGE_INTERFACE $ISOIMAGE
42 44
 
43
-if ([ "$CONFIGURATION" == "standardcontroller" ]); then
45
+if ([ "$CONFIGURATION" == "controllerstorage" ] || [ "$CONFIGURATION" == "dedicatedstorage" ]); then
44 46
     for ((i=0; i<=$COMPUTE_NODES_NUMBER; i++)); do
45 47
         COMPUTE_NODE=${CONFIGURATION}-${COMPUTE}-${i}
46
-        create_compute ${COMPUTE_NODE}
48
+        create_node "compute" ${COMPUTE_NODE} ${BRIDGE_INTERFACE}
49
+    done
50
+fi
51
+
52
+if ([ "$CONFIGURATION" == "dedicatedstorage" ]); then
53
+    for ((i=0; i<=$STORAGE_NODES_NUMBER; i++)); do
54
+        STORAGE_NODE=${CONFIGURATION}-${STORAGE}-${i}
55
+        create_node "storage" ${STORAGE_NODE} ${BRIDGE_INTERFACE}
47 56
     done
48 57
 fi
49 58
 

+ 95
- 0
deployment/libvirt/storage.xml View File

@@ -0,0 +1,95 @@
1
+<domain type='kvm' id='187'>
2
+  <name>NAME</name>
3
+  <memory unit='KiB'>16777216</memory>
4
+  <currentMemory unit='KiB'>16777216</currentMemory>
5
+  <vcpu placement='static'>4</vcpu>
6
+  <resource>
7
+    <partition>/machine</partition>
8
+  </resource>
9
+  <os>
10
+    <type arch='x86_64' machine='pc-q35-xenial'>hvm</type>
11
+  </os>
12
+  <features>
13
+    <acpi/>
14
+    <apic/>
15
+    <pae/>
16
+  </features>
17
+  <cpu match='exact'>
18
+    <model fallback='forbid'>Nehalem</model>
19
+    <topology sockets='1' cores='4' threads='1'/>
20
+    <feature policy='require' name='vmx'/>
21
+    <feature policy='optional' name='svm'/>
22
+  </cpu>
23
+  <clock offset='utc'/>
24
+  <on_poweroff>destroy</on_poweroff>
25
+  <on_reboot>restart</on_reboot>
26
+  <on_crash>destroy</on_crash>
27
+  <devices>
28
+    <emulator>/usr/bin/qemu-system-x86_64</emulator>
29
+    <disk type='file' device='disk'>
30
+      <driver name='qemu' type='qcow2'/>
31
+      <source file='DISK0'/>
32
+      <backingStore/>
33
+      <target dev='sda' bus='sata'/>
34
+      <boot order='1'/>
35
+    </disk>
36
+    <disk type='file' device='disk'>
37
+      <driver name='qemu' type='qcow2'/>
38
+      <source file='DISK1'/>
39
+      <backingStore/>
40
+      <target dev='sdb' bus='sata'/>
41
+    </disk>
42
+    <interface type='bridge'>
43
+      <source bridge='%BR1%'/>
44
+      <target dev='vnet8'/>
45
+      <model type='e1000'/>
46
+      <alias name='net0'/>
47
+    </interface>
48
+    <interface type='bridge'>
49
+      <source bridge='%BR2%'/>
50
+      <target dev='vnet9'/>
51
+      <model type='e1000'/>
52
+      <boot order='2'/>
53
+      <alias name='net1'/>
54
+    </interface>
55
+    <interface type='bridge'>
56
+      <source bridge='%BR3%'/>
57
+      <target dev='vnet10'/>
58
+      <model type='virtio'/>
59
+      <alias name='net2'/>
60
+    </interface>
61
+    <interface type='bridge'>
62
+      <source bridge='%BR4%'/>
63
+      <target dev='vnet11'/>
64
+      <model type='virtio'/>
65
+      <alias name='net3'/>
66
+    </interface>
67
+    <serial type='pty'>
68
+      <source path='/dev/pts/12'/>
69
+      <target port='0'/>
70
+      <alias name='serial0'/>
71
+    </serial>
72
+    <console type='pty' tty='/dev/pts/12'>
73
+      <source path='/dev/pts/12'/>
74
+      <target type='serial' port='0'/>
75
+      <alias name='serial0'/>
76
+    </console>
77
+    <input type='mouse' bus='ps2'/>
78
+    <input type='keyboard' bus='ps2'/>
79
+    <graphics type='vnc' port='5903' autoport='yes' listen='127.0.0.1'
80
+keymap='en-us'>
81
+      <listen type='address' address='127.0.0.1'/>
82
+    </graphics>
83
+    <video>
84
+      <model type='cirrus' vram='16384' heads='1'/>
85
+      <alias name='video0'/>
86
+    </video>
87
+    <memballoon model='virtio'>
88
+      <alias name='balloon0'/>
89
+    </memballoon>
90
+  </devices>
91
+  <seclabel type='dynamic' model='apparmor' relabel='yes'>
92
+    <label>libvirt-608ab5c8-8d11-4bdd-885f-f8b5fee12ff0</label>
93
+    <imagelabel>libvirt-608ab5c8-8d11-4bdd-885f-f8b5fee12ff0</imagelabel>
94
+  </seclabel>
95
+</domain>

Loading…
Cancel
Save