如何使用CentOS和XenServer在Linux中使用3个以上的虚拟磁盘

前端之家收集整理的这篇文章主要介绍了如何使用CentOS和XenServer在Linux中使用3个以上的虚拟磁盘前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我已将5个虚拟磁盘连接到Citrix XenServer中的虚拟机. VM已安装xs-tools.最初它说它无法添加这么多磁盘.安装xs-tools后,我可以添加所有磁盘.

但是/ dev没有显示所有磁盘.它显示了这些:

/dev/xvda
/dev/xvdb
/dev/xvdc
/dev/cdrom

也许它受限于IDE总线的限制? (3个磁盘CD-ROM)如果是这样,如何更改VM以使用SCSI?

编辑:
According to the documentation:

2.6.3. VM Block Devices

In the PV Linux case,block devices are passed through as PV devices.
XenServer does not attempt to emulate SCSI or IDE,but instead
provides a more suitable interface in the virtual environment in the
form of xvd* devices. It is also possible to get an sd* device using
the same mechanism,where the PV driver inside the VM takes over the
SCSI device namespace. This is not desirable so it is best to use xvd*
where possible for PV guests (this is the default for Debian and
RHEL).

For Windows or other fully virtualized guests,XenServer emulates an
IDE bus in the form of an hd* device. When using Windows,installing
the Citrix Tools for Virtual Machines installs a special PV driver
that works in a similar way to Linux,except in the fully virtualized
environment.

仍然,连接了5个虚拟磁盘,我没有看到其他xvd设备.

编辑#2 :(附上要求的信息)

主机:

XenServer 6.1
Linux version 2.6.32.43-0.4.1.xs1.6.10.777.170770xen (geeko@buildhost) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-51)) #1 SMP Wed Apr 17 05:52:03 EDT 2013

客机:

CentOS release 6.4 (Final)
Linux version 2.6.32-358.6.2.el6.x86_64 (mockbuild@c6b8.bsys.dev.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC) ) #1 SMP Thu May 16 20:59:36 UTC 2013

在Guest Machine上输出’fdisk -l’:

注意,超出前3个附加的磁盘不显示 – 应该有4个100GB磁盘. (XenCenter中共显示5个磁盘 – 16GB,100GB,100GB)

Disk /dev/xvdb: 107.4 GB,107374182400 bytes
255 heads,63 sectors/track,13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xfb6c95b9

    Device Boot      Start         End      Blocks   Id  System
/dev/xvdb1               1       13054   104856223+  83  Linux

Disk /dev/xvda: 17.2 GB,17179869184 bytes
255 heads,2088 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000e5f41

    Device Boot      Start         End      Blocks   Id  System
/dev/xvda1   *           1          64      512000   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/xvda2              64        2089    16264192   8e  Linux LVM

Disk /dev/xvdc: 107.4 GB,13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xed249ced

    Device Boot      Start         End      Blocks   Id  System
/dev/xvdc1               1       13054   104856223+  83  Linux

Disk /dev/mapper/vg_blue-lv_root: 14.6 GB,14571012096 bytes
255 heads,1771 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/vg_blue-lv_swap: 2080 MB,2080374784 bytes
255 heads,252 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

我看到Linux版本说SMP.来宾VM在名称中没有说“xen”.但是,我已经运行了yum install kernel-xen.可能是一个线索?

同样的问题在这里
我想你会在/ var / log / messages中看到错误信息
blkfront: your disk configuration is incorrect,please use an xvd device instead

GUI中的磁盘是/ dev / hda,/ dev / hdb,/ dev / hdc,但是在RHEL< 6是/ dev / xvda / etc ...
如果将其命名为/ dev / xvd,则可以从cli手动添加磁盘.

发现:http://forums.citrix.com/message.jspa?messageID=1692261检查Albert Czarnecki answeres.

“就像我说你的机器在HVM模式下运行一样.你必须运行命令并从HVM更改为PV:
xe vm-param-set uuid = your_machine PV-bootloader = pygrub HVM-boot-policy =“”然后再次运行机器.“

检查https://www.linuxnet.ch/xenserver-howto-convert-hvm-to-pv-rhelsuse/

编辑:我试过了,现在所有磁盘都可见,系统是PV.

快速摘要(可能有所不同):

xe vm-list name-label=SERVERNAME params=uuid 
uuid ( RO)    : 2a596adf-ccf4-6469-cf89-702d723cfbb9

UUID=`xe vm-list name-label=SERVERNAME params=uuid | cut -d ":" -f 2`

检查PV或HVM

xe vm-param-list uuid=2a596adf-ccf4-6469-cf89-702d723cfbb9 | egrep "PV-bootloader|HVM-boot-policy"
xe vm-param-list uuid=`echo ${UUID}` | egrep "PV-bootloader|HVM-boot-policy"
HVM-boot-policy ( RW): BIOS order
PV-bootloader ( RW): 
PV-bootloader-args ( RW):

设置PV:

xe vm-param-set uuid=2a596adf-ccf4-6469-cf89-702d723cfbb9 PV-bootloader=pygrub HVM-boot-policy=""
xe vm-param-set uuid=`echo ${UUID}` PV-bootloader=pygrub HVM-boot-policy=""

重启后:

fdisk -l 2>/dev/null | grep xvd
Disk /dev/xvdb: 51.5 GB,51539607552 bytes
Disk /dev/xvde: 1073 MB,1073741824 bytes   <------ YEAAAAAH "test disk 1GB visible for os"
Disk /dev/xvda: 16.1 GB,16106127360 bytes
/dev/xvda1   *           1          13      102400   83  Linux
/dev/xvda2              13         274     2097152   82  Linux swap / Solaris
/dev/xvda3             274        1959    13528064   8e  Linux LVM
Disk /dev/xvdc: 1073 MB,1073741824 bytes
原文链接:https://www.f2er.com/centos/373851.html

猜你在找的CentOS相关文章