XenServer安装虚拟机—先扩容存放ISO镜像文件

我们都知道xenserver安装后,不管你的盘有多大,只有4G的空间。

故操作是:新建LV卷,可自定义大小

1、vgdisplay #先查看剩余空间

[root@XenServer /]# vgdisplay

— Volume group —
VG Name VG_XenStorage-205eecff-2466-84fe-56d5-81472e44f3c2
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 8
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
Open LV 0
Max PV 0
Cur PV 1
Act PV 1
VG Size 11.99 GB
PE Size 4.00 MB
Total PE 3069
Alloc PE / Size 1 / 4.00 MB
Free PE / Size 3068 / 11.98 GB
VG UUID gdk23O-Ugch-ygeb-wiZc-aoIr-QbTL-XoQqfx

2、lvdisplay VG_XenStorage-205eecff-2466-84fe-56d5-81472e44f3c2 #查看该区

[root@XenServer /]#  lvdisplay VG_XenStorage-205eecff-2466-84fe-56d5-81472e44f3c2

— Logical volume —
LV Name /dev/VG_XenStorage-205eecff-2466-84fe-56d5-81472e44f3c2/MGT
VG Name VG_XenStorage-205eecff-2466-84fe-56d5-81472e44f3c2
LV UUID qnsQew-gAqU-IEqr-rGsF-jO3j-crwE-eNHqx5
LV Write Access read/write
LV Status NOT available
LV Size 4.00 MB
Current LE 1
Segments 1
Allocation inherit
Read ahead sectors auto

3、lvcreate -L 20GB -n iso VG_XenStorage-205eecff-2466-84fe-56d5-81472e44f3c2 #新建20G的lv卷iso

[root@XenServer /]#  lvcreate -L 20GB -n iso VG_XenStorage-205eecff-2466-84fe-56d5-81472e44f3c2

Logical volume “lviso” created

顺带提一下如何添加空间:

[root@XenServer /]#  lvcreate -n lviso -L +6G VG_XenStorage-205eecff-2466-84fe-56d5-81472e44f3c2

Logical volume “lviso” created

4、lvdisplay VG_XenStorage-205eecff-2466-84fe-56d5-81472e44f3c2 #再次查看该区

[root@XenServer /]#  lvdisplay VG_XenStorage-205eecff-2466-84fe-56d5-81472e44f3c2

— Logical volume —
LV Name /dev/VG_XenStorage-205eecff-2466-84fe-56d5-81472e44f3c2/MGT
VG Name VG_XenStorage-205eecff-2466-84fe-56d5-81472e44f3c2
LV UUID qnsQew-gAqU-IEqr-rGsF-jO3j-crwE-eNHqx5
LV Write Access read/write
LV Status NOT available
LV Size 4.00 MB
Current LE 1
Segments 1
Allocation inherit
Read ahead sectors auto

— Logical volume —
LV Name /dev/VG_XenStorage-205eecff-2466-84fe-56d5-81472e44f3c2/iso
VG Name VG_XenStorage-205eecff-2466-84fe-56d5-81472e44f3c2
LV UUID lmJmYH-OiRW-gQle-nCJk-Y9M9-zVev-JGvrqK
LV Write Access read/write
LV Status available
# open 0
LV Size 20.00 GB
Current LE 1536
Segments 1
Allocation inherit
Read ahead sectors auto
– currently set to 1024
Block device 252:1

5、mkfs.ext3 /dev/VG_XenStorage-205eecff-2466-84fe-56d5-81472e44f3c2/iso #格式化为ext3格式

[root@XenServer /]#  mkfs.ext3 /dev/VG_XenStorage-205eecff-2466-84fe-56d5-81472e44f3c2/iso
[root@XenServer /]#

6、mkdir /iso #在根目录下建立iso文件夹,用于ISO镜像文件的挂载

[root@XenServer /]#  mkdir /iso
[root@XenServer /]#

7、vgchange -a y #激活所有卷组

8、mount /dev/VG_XenStorage-205eecff-2466-84fe-56d5-81472e44f3c2/lviso /iso #挂载/ISO文件夹下的iso镜像文件

[root@XenServer /]#  mount /dev/VG_XenStorage-205eecff-2466-84fe-56d5-81472e44f3c2/lviso  /iso
[root@XenServer /]#

9、df -h #查看容量

[root@XenServer /]#  df -h

Filesystem Size Used Avail Use% Mounted on
/dev/sda1 4.0G 1.7G 2.1G 46% /
none 380M 0 380M 0% /dev/shm
/opt/xensource/packages/iso/XenCenter.iso
44M 44M 0 100% /var/xen/xc-install
/dev/mapper/XSLocalEXT–5983fa21–42bd–0cd6–aafd–78534a7908f7-5983fa21–42bd–0cd6–aafd–78534a7908f7
9.9G 911M 8.5G 10% /var/run/sr-mount/5983fa21-42bd-0cd6-aafd-78534a7908f7
/dev/mapper/VG_XenStorage–205eecff–2466–84fe–56d5–81472e44f3c2-lviso
6.0G 141M 5.5G 3% /ISO

10、通过Xftp 软件将 下载好的iso镜像文件上传到 /iso 目录中 注意更改 文件权限755

在这就可以转到XenCenter客户端操作了

XenServer VM物理CPU使用策略  http://www.linuxidc.com/Linux/2013-08/88698.htm

CloudStack编译环境XenServer启动系统虚拟机失败 http://www.linuxidc.com/Linux/2013-08/88694.htm

禁止CloudStack删除XenServer原有虚拟机 http://www.linuxidc.com/Linux/2013-08/88693.htm

XenServer中设置Linux VM从光驱引导 http://www.linuxidc.com/Linux/2013-07/87699.htm

开启并配置Citrix XenServer的SNMP服务 http://www.linuxidc.com/Linux/2013-01/78487.htm

重置XenServer本地磁盘LVM为EXT3格式 http://www.linuxidc.com/Linux/2013-11/92282.

Add a Comment

电子邮件地址不会被公开。 必填项已用*标注