1)使用本地盘创建2个LV
--- Logical volume ---
LV Path /dev/vg_cg/ceph1
LV Name ceph1
VG Name vg_cg
LV UUID 57Bhej-KcfF-ZffE-cNjH-Upr9-3Q29-hYswpC
LV Write Access read/write
LV Creation host, time cg.sci, 2014-08-08 09:50:34 +0800
LV Status available
# open 5
LV Size 50.00 GiB
Current LE 12800
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:3
--- Logical volume ---
LV Path /dev/vg_cg/ceph2
LV Name ceph2
VG Name vg_cg
LV UUID 0pjRi8-eDok-2x4W-9dRv-3Oei-sQ5x-LyB0lQ
LV Write Access read/write
LV Creation host, time cg.sci, 2014-08-08 09:50:39 +0800
LV Status available
# open 0
LV Size 50.00 GiB
Current LE 12800
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:4
2)使用vdsClient的createVG命令创建VG
[root@cg storage]# vdsClient localhost createVG aaaaaaaa-bbbb-cccc-eeee-dddddddddddd vg_cg-ceph1 vg_cg-ceph2
6kz1Fq-hksB-vD04-0pSV-b2kp-BV6g-cu0kBb
3)看一下VG的信息
[root@cg storage]# vdsClient localhost getVGList
============================
vgsize = 53284438016
name = aaaaaaaa-bbbb-cccc-eeee-dddddddddddd
vgUUID = 6kz1Fq-hksB-vD04-0pSV-b2kp-BV6g-cu0kBb
state = OK
vgfree = 49123688448
type = 3
attr = {'partial': '-', 'permission': 'w', 'allocation': 'n', 'exported': '-', 'clustered': '-', 'resizeable': 'z'}
4)vdsClient调用的实际上就是lvm的命令,因此可以用vgdisplay看到新创建的VG
--- Volume group ---
VG Name aaaaaaaa-bbbb-cccc-eeee-dddddddddddd
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 8
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 6
Open LV 0
Max PV 0
Cur PV 1
Act PV 1
VG Size 49.62 GiB
PE Size 128.00 MiB
Total PE 397
Alloc PE / Size 31 / 3.88 GiB
Free PE / Size 366 / 45.75 GiB
VG UUID 6kz1Fq-hksB-vD04-0pSV-b2kp-BV6g-cu0kBb
5)创建Storage Domain,随意指定SD的UUID为b9c4821e-e9c0-4dd4-8393-c59b82c9cd29,得到一个error信息
[root@cg ~]# vdsClient localhost createStorageDomain 3 b9c4821e-e9c0-4dd4-8393-c59b82c9cd29 ceph-domain 6kz1Fq-hksB-vD04-0pSV-b2kp-BV6g-cu0kBb 1 0
Cannot activate Logical Volumes: ('General Storage Exception: (\'5 [] [\\\' Volume group "b9c4821e-e9c0-4dd4-8393-c59b82c9cd29" not found\\\', \\\' Skipping volume group b9c4821e-e9c0-4dd4-8393-c59b82c9cd29\\\']\\nb9c4821e-e9c0-4dd4-8393-c59b82c9cd29/[\\\'metadata\\\']\',)',)
6)但可以看到实际上已创建了一个SD,其UUID正是上面创建VG是时指定的VG Name,类型则是iSCSI
[root@cg ~]# vdsClient localhost getStorageDomainsList
aaaaaaaa-bbbb-cccc-eeee-dddddddddddd
[root@cg ~]# vdsClient localhost getStorageDomainInfo aaaaaaaa-bbbb-cccc-eeee-dddddddddddd
uuid = aaaaaaaa-bbbb-cccc-eeee-dddddddddddd
vguuid = 6kz1Fq-hksB-vD04-0pSV-b2kp-BV6g-cu0kBb
state = OK
version = 0
role = Regular
type = ISCSI
class = Data
pool = []
name = ceph-domain
7)并且,在创建Storage Domain时,此VG内部会创建6个LV,放置Storage Domain的元数据
SPECIAL_LVS = (sd.METADATA, sd.LEASES, sd.IDS, sd.INBOX, sd.OUTBOX, MASTERLV)
--- Logical volume ---
LV Path /dev/aaaaaaaa-bbbb-cccc-eeee-dddddddddddd/metadata
LV Name metadata
VG Name aaaaaaaa-bbbb-cccc-eeee-dddddddddddd
LV UUID A0TLg6-We01-aSKM-cgK3-nCz5-QkXF-TWSbhW
LV Write Access read/write
LV Creation host, time cg.sci, 2014-08-09 11:00:57 +0800
LV Status available
# open 0
LV Size 512.00 MiB
Current LE 4
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:5
--- Logical volume ---
LV Path /dev/aaaaaaaa-bbbb-cccc-eeee-dddddddddddd/outbox
LV Name outbox
VG Name aaaaaaaa-bbbb-cccc-eeee-dddddddddddd
LV UUID HfeNUh-psQ0-PVQW-0neb-Rer2-jM8K-feL4P9
LV Write Access read/write
LV Creation host, time cg.sci, 2014-08-09 11:00:58 +0800
LV Status available
# open 0
LV Size 128.00 MiB
Current LE 1
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:6
--- Logical volume ---
LV Path /dev/aaaaaaaa-bbbb-cccc-eeee-dddddddddddd/leases
LV Name leases
VG Name aaaaaaaa-bbbb-cccc-eeee-dddddddddddd
LV UUID VkMnlE-qjBt-kjRI-Cpow-m203-XXPX-U1osgF
LV Write Access read/write
LV Creation host, time cg.sci, 2014-08-09 11:00:58 +0800
LV Status available
# open 0
LV Size 2.00 GiB
Current LE 16
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:7
--- Logical volume ---
LV Path /dev/aaaaaaaa-bbbb-cccc-eeee-dddddddddddd/ids
LV Name ids
VG Name aaaaaaaa-bbbb-cccc-eeee-dddddddddddd
LV UUID eXHVNc-9wDN-eBBV-WgYs-5czw-qcmL-oobRZX
LV Write Access read/write
LV Creation host, time cg.sci, 2014-08-09 11:00:58 +0800
LV Status available
# open 0
LV Size 128.00 MiB
Current LE 1
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:8
--- Logical volume ---
LV Path /dev/aaaaaaaa-bbbb-cccc-eeee-dddddddddddd/inbox
LV Name inbox
VG Name aaaaaaaa-bbbb-cccc-eeee-dddddddddddd
LV UUID bpjmRn-kfRD-A2nn-vDsM-Bpw8-AJnH-AL8tW8
LV Write Access read/write
LV Creation host, time cg.sci, 2014-08-09 11:00:59 +0800
LV Status available
# open 0
LV Size 128.00 MiB
Current LE 1
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:9
--- Logical volume ---
LV Path /dev/aaaaaaaa-bbbb-cccc-eeee-dddddddddddd/master
LV Name master
VG Name aaaaaaaa-bbbb-cccc-eeee-dddddddddddd
LV UUID qXhT4v-8cXT-0fHU-4vIt-AUOy-pp9m-l3i178
LV Write Access read/write
LV Creation host, time cg.sci, 2014-08-09 11:00:59 +0800
LV Status NOT available
LV Size 1.00 GiB
Current LE 8
Segments 1
Allocation inherit
Read ahead sectors auto
[root@cg ~]# ll /dev/mapper/
总用量 0
lrwxrwxrwx. 1 root root 7 8月 9 11:00 aaaaaaaa--bbbb--cccc--eeee--dddddddddddd-ids -> ../dm-8
lrwxrwxrwx. 1 root root 7 8月 9 11:01 aaaaaaaa--bbbb--cccc--eeee--dddddddddddd-inbox -> ../dm-9
lrwxrwxrwx. 1 root root 7 8月 9 11:00 aaaaaaaa--bbbb--cccc--eeee--dddddddddddd-leases -> ../dm-7
lrwxrwxrwx. 1 root root 8 8月 9 11:22 aaaaaaaa--bbbb--cccc--eeee--dddddddddddd-master -> ../dm-10
lrwxrwxrwx. 1 root root 7 8月 9 11:01 aaaaaaaa--bbbb--cccc--eeee--dddddddddddd-metadata -> ../dm-5
lrwxrwxrwx. 1 root root 7 8月 9 11:01 aaaaaaaa--bbbb--cccc--eeee--dddddddddddd-outbox -> ../dm-6
crw-rw----. 1 root root 10, 58 8月 9 10:50 control
lrwxrwxrwx. 1 root root 7 8月 9 11:01 vg_cg-ceph1 -> ../dm-3
lrwxrwxrwx. 1 root root 7 8月 9 10:55 vg_cg-ceph2 -> ../dm-4
lrwxrwxrwx. 1 root root 7 8月 9 10:50 vg_cg-lv_home -> ../dm-2
lrwxrwxrwx. 1 root root 7 8月 9 10:50 vg_cg-lv_root -> ../dm-0
lrwxrwxrwx. 1 root root 7 8月 9 10:50 vg_cg-lv_swap -> ../dm-1