XenServer Bonding LACP

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 挂在存储磁盘

fdisk /dev/nvme0n1

n 新建分区
p 分区类型为主分区
enter
enter

t 修改分区格式
8e 类型改为8e LVM
p 查看当前分区

w 写入分区

partprobe 使分区表生效,无需重启

pvcreate /dev/nvme0n1 --config global{metadata_read_only=0} 使用pvcreate转换

pvdisplay 查看已经存在的pv

vgcreate nvme0n1VG /dev/nvme0n1 --config global{metadata_read_only=0} 创建VG,可利用已经存在的VG名(myVG),同一VG名下的一组PV构成一个VG

vgdisplay 查看VG 创建完成VG之后,才能从VG中划分一个LV

lvcreate -l 100%FREE -n nvme0n1LV nvme0n1VG --config global{metadata_read_only=0} 创建LV,并把VG所有剩余空间分给LV

lvdisplay 显示LV的信息

mkfs.ext4 /dev/nvme0n1VG/nvme0n1LV 对LV进行格式化(使用mksf进行格式化操作),然后LV才能存储资料

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服务器的文件系统的磁盘空间占用情况


cat /proc/partitions

ll /dev/disk/by-id

xe sr-create content-type=user device-config:device=/dev/disk/by-id/ 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/ host-uuid= name-label=”Local Storage 2” shared=false type=lvm

  • Or -

xe sr-create content-type=user device-config:device=/dev/ 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

找到要删除的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/ 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 新建分区
p 分区类型为主分区
enter
enter

t 修改分区格式
8e 类型改为8e LVM
p 查看当前分区

w 写入分区

partprobe 使分区表生效,无需重启

pvcreate /dev/nvme0n1 --config global{metadata_read_only=0} 使用pvcreate转换

pvdisplay 查看已经存在的pv

vgcreate nvme0n1VG /dev/nvme0n1 --config global{metadata_read_only=0} 创建VG,可利用已经存在的VG名(myVG),同一VG名下的一组PV构成一个VG

vgdisplay 查看VG 创建完成VG之后,才能从VG中划分一个LV

lvcreate -l 100%FREE -n nvme0n1LV nvme0n1VG --config global{metadata_read_only=0} 创建LV,并把VG所有剩余空间分给LV

lvdisplay 显示LV的信息

mkfs.ext4 /dev/nvme0n1VG/nvme0n1LV 对LV进行格式化(使用mksf进行格式化操作),然后LV才能存储资料

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服务器的文件系统的磁盘空间占用情况


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服务器的文件系统的磁盘空间占用情况

cat /dev/disk/by-uuid/

你可能感兴趣的:(XenServer Bonding LACP)