@@ -12,14 +12,68 @@ ssh root@localhost -p 2022 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/de
1212ssh root@localhost -p 1122 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null
1313```
1414
15- # Cinder & tgtd
15+ # Cinder & NFS backend
1616
1717## Create volume
1818
1919* login in to ` controllerVM ` or ` storageVM `
2020
2121``` bash
22- openstack volume create --size 4 TEST_VOL
22+ openstack volume create --size 4 test_vol
23+ ```
24+
25+ * Cinder will create a volume on the mounted nfs share. ` /var/lib/cinder/mnt/8216055ab12dc06650bdd79b0d5a6c84 `
26+ * The storageVM provides the nfs share itself from ` /dev/vdb ` mounted on ` /exports `
27+
28+ ## Assign volume to a VM
29+
30+ * create a new VM with: ` openstack server create `
31+ * or look into system unit: ` openstack-create-vm ` on VM ` controllerVM `
32+
33+ * attach volume to vm
34+
35+ ``` bash
36+ openstack server list
37+ openstack volume list
38+ openstack server add volume < INSTANCE_NAME_OR_ID> < VOLUME_NAME_OR_ID>
39+ ```
40+
41+ * Verify if the nfs store is mounted on the ` computeVM `
42+
43+ ``` bash
44+ [root@computeVM:~ ]# df -h | grep export
45+ 10.0.0.20:/exports 503G 2.0M 503G 1% /var/lib/nova/mnt/8216055ab12dc06650bdd79b0d5a6c84
46+ ```
47+
48+ * Verify block device mapping is working in the test VM.
49+
50+ ``` bash
51+ [root@controllerVM:~ ]# openstack server list
52+ +--------------------------------------+---------+--------+------------------------+--------+---------+
53+ | ID | Name | Status | Networks | Image | Flavor |
54+ +--------------------------------------+---------+--------+------------------------+--------+---------+
55+ | fd43f442-d482-49bf-a4d8-a19ac03e36c3 | test_vm | ACTIVE | provider=192.168.44.85 | cirros | m1.nano |
56+ +--------------------------------------+---------+--------+------------------------+--------+---------+
57+
58+ NETNS=$( ip netns list | cut -f 1 -d ' ' )
59+ VMIP=$( openstack server show test_vm -f value -c addresses | cut -f 4 -d " '" )
60+ ip netns exec $NETNS ssh cirros@${VMIP} -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null lsblk
61+
62+ NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
63+ vda 252:0 0 112M 0 disk
64+ | -vda1 252:1 0 103M 0 part /
65+ ` -vda15 252:15 0 8M 0 part
66+ vdb 252:16 0 4G 0 disk
67+ ` ` `
68+
69+ # Cinder & tgtd backend
70+
71+ # # Create volume
72+
73+ * login in to ` controllerVM` or ` storageVM`
74+
75+ ` ` ` bash
76+ openstack volume create --size 4 test_vol
2377` ` `
2478
2579* Cinder will create a LVM logical volume in the volume group ` cinder-volumes` .
0 commit comments