ifenslave
bond45_uuid=xe network-create name-label=bond45
host_uuids=xe host-list|grep uuid|awk '{print $5}'
for host_uuid in $(echo $host_uuids | awk '{print;}')
do
host_eth4_pif=`xe pif-list host-uuid=$host_uuid device=eth4|grep -E '^uuid'|awk '{print $5}'`
host_eth5_pif=`xe pif-list host-uuid=$host_uuid device=eth5|grep -E '^uuid'|awk '{print $5}'`
xe bond-create network-uuid=$bond45_uuid pif-uuids=$host_eth4_pif,$host_eth5_pif mode=lacp
done
xenserver 掛在存儲(chǔ)磁盤
fdisk /dev/nvme0n1
n 新建分區(qū)
p 分區(qū)類型為主分區(qū)
enter
enter
t 修改分區(qū)格式
8e 類型改為8e LVM
p 查看當(dāng)前分區(qū)
w 寫入分區(qū)
partprobe 使分區(qū)表生效雏吭,無需重啟
pvcreate /dev/nvme0n1 --config global{metadata_read_only=0} 使用pvcreate轉(zhuǎn)換
pvdisplay 查看已經(jīng)存在的pv
vgcreate nvme0n1VG /dev/nvme0n1 --config global{metadata_read_only=0} 創(chuàng)建VG梗夸,可利用已經(jīng)存在的VG名(myVG),同一VG名下的一組PV構(gòu)成一個(gè)VG
vgdisplay 查看VG 創(chuàng)建完成VG之后界轩,才能從VG中劃分一個(gè)LV
lvcreate -l 100%FREE -n nvme0n1LV nvme0n1VG --config global{metadata_read_only=0} 創(chuàng)建LV,并把VG所有剩余空間分給LV
lvdisplay 顯示LV的信息
mkfs.ext4 /dev/nvme0n1VG/nvme0n1LV 對(duì)LV進(jìn)行格式化(使用mksf進(jìn)行格式化操作)衔瓮,然后LV才能存儲(chǔ)資料
blkid /dev/nvme0n1VG/nvme0n1LV
mkdir /nvme0n1
echo 'UUID=a5d3a67a-aad4-4eea-91ce-1b1fc56ffe9f /nvme0n1 ext4 defaults 0 0' >/etc/fstab
mount -a
mount /dev/nvme0n1VG/nvme0n1LV /nvme0n1
df -hP
host_uuids=xe host-list|grep uuid|awk '{print $5}'
xe sr-create content-type=user device-config:device=/dev/nvme0n1VG/nvme0n1LV host-uuid=12244cc8-1958-40e1-a4a3-24a1a3542293 name-label="Local storage2" shared=false type=lvm
df -h 檢查linux服務(wù)器的文件系統(tǒng)的磁盤空間占用情況
cat /proc/partitions
ll /dev/disk/by-id
xe sr-create content-type=user device-config:device=/dev/disk/by-id/<scsi-xxxxxxxxxxxxxxxxxxxxxxxxx> host-uuid=<host-uuid> name-label=”Local Storage 2” shared=false type=lvm
- Or -
xe sr-create content-type=user device-config:device=/dev/disk/b y-id/<cciss-xxxxxxxxxxxxxxxxxxxxxxxxx> host-uuid=<host-uuid> name-label=”Local Storage 2” shared=false type=lvm
- Or -
xe sr-create content-type=user device-config:device=/dev/<sdx> host-uuid=<host-uuid> name-label=”Local Storage 2” shared=false type=lvm
xe sr-create content-type=user device-config:/dev/XSLocalEXT-83a61471-2405-72b3-a594-f1042329fd0b/83a61471-2405-72b3-a594-f1042329fd0b host-uuid=e2cde32e-aa28-4f25-8941-67fc0d398d3d name-label="Local storage" shared=false type=lvm
找到要?jiǎng)h除的sr
xe sr-list
xe pbd-list sr-uuid=sr-uuid
斷開連接
xe pbd-unplug uuid=pbd-uuid
刪除sr
xe sr-destroy uuid=sr-uuid
xe sr-forget uuid=sr-uuid
host_uuids=xe host-list|grep uuid|awk '{print $5}'
lvdisplay
xe sr-create content-type=user device-config:device=/dev/<sdx> host-uuid=<host-uuid> name-label="Local Storage" shared=false type=lvm
xe sr-create content-type=user device-config:device=/dev/XSLocalEXT-37269b49-a03b-af83-5dc0-d298f7fa3a72/nvme0n1LV host-uuid=966b29da-7834-4438-a70e-b3eca14cea1e name-label="Local Storage2" shared=false type=lvm
vgdisplay
lvcreate -L 10GB -n localiso {VG Name} --config global{metadata_read_only=0}
mkdir /iso
mkfs.ext4 /dev/{VG Name}/localiso
echo 'UUID=b92d4e6d-135d-498d-8e52-58f4f4002dee /iso ext4 defaults 0 0' >/etc/fstab
mount -a
df -hP
xe sr-create name-label=iso_image type=iso device-config:location=/iso device-config:legacy_mode=true content-type=iso
vgdisplay
lvcreate -L 20GB -n localiso XSLocalEXT-59746ca6-265d-3b15-4371-3a6aa510a0a7 --config global{metadata_read_only=0}
mkdir /iso
mkfs.ext4 /dev/XSLocalEXT-59746ca6-265d-3b15-4371-3a6aa510a0a7/localiso
blkid /dev/XSLocalEXT-59746ca6-265d-3b15-4371-3a6aa510a0a7/localiso
echo 'UUID=36b396ad-d5a0-4568-ad61-a1209e9ebae8 /iso ext4 defaults 0 0' >/etc/fstab
mount -a
df -hP
xe sr-create name-label=iso_image type=iso device-config:location=/iso device-config:legacy_mode=true content-type=iso
fdisk /dev/nvme0n1
n 新建分區(qū)
p 分區(qū)類型為主分區(qū)
enter
enter
t 修改分區(qū)格式
8e 類型改為8e LVM
p 查看當(dāng)前分區(qū)
w 寫入分區(qū)
partprobe 使分區(qū)表生效浊猾,無需重啟
pvcreate /dev/nvme0n1 --config global{metadata_read_only=0} 使用pvcreate轉(zhuǎn)換
pvdisplay 查看已經(jīng)存在的pv
vgcreate nvme0n1VG /dev/nvme0n1 --config global{metadata_read_only=0} 創(chuàng)建VG,可利用已經(jīng)存在的VG名(myVG)热鞍,同一VG名下的一組PV構(gòu)成一個(gè)VG
vgdisplay 查看VG 創(chuàng)建完成VG之后葫慎,才能從VG中劃分一個(gè)LV
lvcreate -l 100%FREE -n nvme0n1LV nvme0n1VG --config global{metadata_read_only=0} 創(chuàng)建LV,并把VG所有剩余空間分給LV
lvdisplay 顯示LV的信息
mkfs.ext4 /dev/nvme0n1VG/nvme0n1LV 對(duì)LV進(jìn)行格式化(使用mksf進(jìn)行格式化操作)薇宠,然后LV才能存儲(chǔ)資料
blkid /dev/nvme0n1VG/nvme0n1LV
mkdir /nvme0n1
echo 'UUID=9c85b8d6-0d33-46b2-8ea7-7741d6111181 /nvme0n1 ext4 defaults 0 0' >/etc/fstab
mount -a
mount /dev/nvme0n1VG/nvme0n1LV /nvme0n1
df -hP
host_uuids=xe host-list|grep uuid|awk '{print $5}'
xe sr-create content-type=user device-config:device=/dev/nvme0n1VG/nvme0n1LV host-uuid=12244cc8-1958-40e1-a4a3-24a1a3542293 name-label="Local storage2" shared=false type=lvm
df -h 檢查linux服務(wù)器的文件系統(tǒng)的磁盤空間占用情況
lvcreate -L 2T -n myData XSLocalEXT-59746ca6-265d-3b15-4371-3a6aa510a0a7 --config global{metadata_read_only=0}
lvdisplay
mkfs.ext4 /dev/XSLocalEXT-278d3e8e-0c89-6d8c-4211-baf8bcdc904e/278d3e8e-0c89-6d8c-4211-baf8bcdc904e
blkid /dev/XSLocalEXT-278d3e8e-0c89-6d8c-4211-baf8bcdc904e/278d3e8e-0c89-6d8c-4211-baf8bcdc904e
mkdir /myData
echo 'UUID=09cdb738-a221-4a06-9d5e-cb348417cfcc /myData ext4 defaults 0 0' >/etc/fstab
mount -a
mount /dev/nvme0n1VG/nvme0n1LV /nvme0n1
df -hP
host_uuids=xe host-list|grep uuid|awk '{print $5}'
xe sr-create content-type=user device-config:device=/dev/XSLocalEXT-278d3e8e-0c89-6d8c-4211-baf8bcdc904e/278d3e8e-0c89-6d8c-4211-baf8bcdc904e host-uuid=ca8bd35c-9b8c-48ab-8c56-1800caf02f15 name-label="Storage1" shared=false type=lvm
df -h 檢查linux服務(wù)器的文件系統(tǒng)的磁盤空間占用情況
cat /dev/disk/by-uuid/