进入xenserver与xen的关系的sr在哪

图解XenServer的SR/VDI/VBD之间的关系
日期:来源:
  今天在xenserver5.6下给一ubuntu VM添加virtual disk时提示不能添加,如下图  查了下文档原来是因为每个VM都有disk数量的限制  The current version of the XenServer product family has the following general limitations on virtual devices for VMs. Note that specific guest operating systems may have lower limits for certain features. These limitations are noted in the individual guest installation section.  *A maximum of 8 VCPUs are supported by XenCenter.  *except for SLES 10 SP1 and RHEL 4.x, which support 3. RHEL 5.0/5.1/5.2 support 3, but can support 7 when the kernel is patched with the Citrix Tools for Virtual Machines. The same applies for Oracle and CentOS 5.0/5.1/5.2  google了下,发现虽然不能通过xencenter添加,但是xenserver也支持CLI命令行的方式来管理。在使用xe命令添加vdisk时,首先需要理解xenserver下的SR,VDI,VBD这三个概念。如下图  存储库 (SR)  虚拟磁盘映像 (VDI)  物理块设备 (PBD)  虚拟块设备 (VBD)  下面就以图形来说明这些术语之间的关系。  1、SR  定义了一个名为存储库 (SR) 的容器来描述存储虚拟磁盘映像 (VDI) 的特定存储目标。SR 具有对本地连接的 IDE、SATA、SCSI 和 SAS驱动器和远程连接的 iSCSI、NFS、SAS 和光纤通道的内置支持,因而非常灵活。  利用xe命令看到如下信息,部分显示内容被省略  [root@xs-10 ~]# xe sr-list  [root@xs-10 ~]# xe sr-list name-label=xenserver   uuid ( RO)&&&&&&&&&&&&&&& : 8d-fbdf-f390529 &&&&&&&&& name-label ( RW): xenserver &&& name-description ( RW): iSCSI SR [172.20.10.107 (iqn.2007-:techtest.xenserver)] &&&&&&&&&&&&&&& host ( RO): xs-10.8 &&&&&&&&&&&&&&& type ( RO): lvmoiscsi &&&&&&& content-type ( RO):   uuid ( RO)&&&&&&&&&&&&&&& : c2be-b936-d36de&&&&&&&&& name-label ( RW): vmware vsphere&&& name-description ( RW): CIFS ISO Library [\\172.20.1.249\software\ISO\vmware vsphere]&&&&&&&&&&&&&&& host ( RO): xs-10.8&&&&&&&&&&&&&&& type ( RO): iso&&&&&&& content-type ( RO): iso  uuid ( RO)&&&&&&&&&&&&&&& : 4188b1ee-76bc-10ed-dc15-6c7a236ce9aa&&&&&&&&& name-label ( RW): Ubuntu&&& name-description ( RW): CIFS ISO Library [\\172.20.1.249\software\ISO\linux\Ubuntu]&&&&&&&&&&&&&&& host ( RO): xs-10.8&&&&&&&&&&&&&&& type ( RO): iso&&&&&&& content-type ( RO): iso  结合图形,不难理解,所谓的SR就是一个存储仓库,里面存储了很多的ISO文件,你可以利用这些ISO文件来存储东西,如vmware vsphere、ubuntu这两个SR。又或者当做存储虚拟机文件的仓库,例如xenserver这个SR。下面接着看SR下一层的对象,叫做VDI  2、VDI  虚拟磁盘映像是显示给 VM 的存储抽象,VDI 是 XenServer 中的虚拟化存储的基本单元。  下面我们看一下Ubuntu这个SR存储库中有哪些VDI,即VDI是包含在SR中的。  [root@xs-10 ~]# xe vdi-list sr-uuid=4188b1ee-76bc-10ed-dc15-6c7a236ce9aa   uuid ( RO)&&&&&&&&&&&&&&& : 5b5bd9b4-b061-4e55-ab8f-a6e&&&&&&&&& name-label ( RW): ubuntu-11.04-desktop-i386.iso&&& name-description ( RW):&&&&&&&&&&&& sr-uuid ( RO): 4188b1ee-76bc-10ed-dc15-6c7a236ce9aa&&&&&&& virtual-size ( RO): &&&&&&&&&&& sharable ( RO): false&&&&&&&&&& read-only ( RO): true  uuid ( RO)&&&&&&&&&&&&&&& : a81d7dcc-27bb-45cc-8c8b-c761cb1f1a04&&&&&&&&& name-label ( RW): ubuntu-11.10-desktop-amd64.iso&&& name-description ( RW):&&&&&&&&&&&& sr-uuid ( RO): 4188b1ee-76bc-10ed-dc15-6c7a236ce9aa&&&&&&& virtual-size ( RO): &&&&&&&&&&& sharable ( RO): false&&&&&&&&&& read-only ( RO): true  uuid ( RO)&&&&&&&&&&&&&&& : 98354aff-f259-4ba4-8617-fb53cc6c08b7&&&&&&&&& name-label ( RW): ubuntu-10.04.3-server-i386.iso&&& name-description ( RW):&&&&&&&&&&&& sr-uuid ( RO): 4188b1ee-76bc-10ed-dc15-6c7a236ce9aa&&&&&&& virtual-size ( RO): &&&&&&&&&&& sharable ( RO): false&&&&&&&&&& read-only ( RO): true  部分省略。。。  ubuntu这个SR所包含的VDI截图如下  而xenserver这个SR下面含有如下的VDI  可以看到VDI。由截图不难看出,所谓的VDI就是里面的ISO文件或虚拟机的硬盘文件。下面我们继续vbd  3、VBD  虚拟块设备是连接器对象(与上述的 PBD 类似),可用于在 VDI 和 VM 之间进行映射。VBD 还可用于微调给定 VDI 的 QoS(服务质量)、统计数据和可引导性等相关参数。  上文中讲述的VDI只是一些ISO文件或虚拟机的硬盘文件,这些文件如果单独放在一起是没有任何价值的。正如描述中的那样,VBD是用在VDI和VM之间的映射,如果没了这层映射,光有VDI也是不行的。  利用xe命令查看“UCA-VM-10.24”这个主机含有哪些VBD,首先查看UCA-VM-10.24的UUID号& [root@xs-10 ~]# xe vm-list name-label=UCA-VM-10.24  uuid ( RO)&&&&&&&&&& : 7-76a6-387e-86daaca15bef&&&& name-label ( RW): UCA-VM-10.24&&& power-state ( RO): halted  再查看  [root@xs-10 ~]# xe vbd-list vm-uuid=7-76a6-387e-86daaca15bef  uuid ( RO)&&&&&&&&&&&& : a798413b-df47-9fb5-4b4d-56539a26eaf2&&&&&&&&& vm-uuid ( RO): 7-76a6-387e-86daaca15bef&&& vm-name-label ( RO): UCA-VM-10.24&&&&&&&& vdi-uuid ( RO): 34fc2c1c-a3aa-43c7-95e4-b8bf6603e52f&&&&&&&&&&& empty ( RO): false&&&&&&&&&& device ( RO): hda  uuid ( RO)&&&&&&&&&&&& : 5ae-ac62-c282-9b89bf8cb7b6&&&&&&&&& vm-uuid ( RO): 7-76a6-387e-86daaca15bef&&& vm-name-label ( RO): UCA-VM-10.24&&&&&&&& vdi-uuid ( RO): &not in database&&&&&&&&&&&& empty ( RO): true&&&&&&&&&& device ( RO): hdd  uuid ( RO)&&&&&&&&&&&& : 07fe6b36-c836-d99e-e3ea-8b8eda2fe134&&&&&&&&& vm-uuid ( RO): 7-76a6-387e-86daaca15bef&&& vm-name-label ( RO): UCA-VM-10.24&&&&&&&& vdi-uuid ( RO): 56c1b396--ba8f-e&&&&&&&&&&& empty ( RO): false&&&&&&&&&& device ( RO): hdc  uuid ( RO)&&&&&&&&&&&& : 49d4e02d-f7e6-ec4a-235e-16bcddb64a99&&&&&&&&& vm-uuid ( RO): 7-76a6-387e-86daaca15bef&&& vm-name-label ( RO): UCA-VM-10.24&&&&&&&& vdi-uuid ( RO): 6ee-b22bf340098&&&&&&&&&&& empty ( RO): false&&&&&&&&&& device ( RO): hdb  可以看出上面的VBD其实将第2节中的VDI和UCA-VM-10.24这个虚拟机做了个映射。也就是说如果我将上图中的disk1这个VDI attach到另一个主机如SQL Server,则VDI不变,而你用xe vbd-list 这个命令查看UCA-VM-10.24这个主机时,会发现少了一个VBD,而SQL Server主机会多了一个VBD。  知道了如上的原理,接下来添加virtual disk就好办了,步骤很简单:  1、在某个SR下面建新的vdi,命名为disk3,其实就是创建虚拟机的硬盘文件  xe vdi-create name-label=disk3 type=user sr-uuid=8d-fbdf-f390529 virtual-size=4GiB 5b4dfa6a-17f0--9d205f4517a9--新的VDI的UUID  2、利用新得到的vdi号创建新的vbd,其实就是为上一步创建的硬盘文件和虚拟机之间做映射  [root@xs-10 ~]# xe vbd-create vdi-uuid=5b4dfa6a-17f0--9d205f4517a9 device=5 vm-uuid=7-76a6-387e-86daaca15bef 9bcad328-4006-fb95-eea8-87de94bf0ff8  3、将创建的vbd plug即可。  [root@xs-10 ~]# xe vbd-plug uuid=9bcad328-4006-fb95-eea8-87de94bf0ff8 You attempted an operation on a VM which requires PV drivers to be installed but the drivers were not detected. vm: 7-76a6-387e-86daaca15bef (UCA-VM-10.24)&
微信公众号
TechTarget
TechTarget中国
我们如何判断服务器虚拟化是中小企业的正确选择呢?服务器虚拟化到底有哪些优势呢?应该选择哪种虚拟机呢?
用户在服务器上安装思杰的XenServer产品时,会遭遇无限重启问题。怎么办呢?本文多图为您解答。
在新的一年,VMware的宏伟目标势必要求它兼顾一些可能有冲突的抉择,处理好关键问题,才能保持迅猛的发展势头。建议VMware应做好这几方面的工作。
安装虚拟化工具到虚拟机(VM)始终是一个好主意,不管是在虚拟机管理程序还是虚拟机操作系统(OS)。本文介绍如何在Windows Server 2012下安装Xenserver工具。
本期《虚拟机资源配置指南》技术手册旨在帮助IT管理员找准虚拟机资源合理分配的界线,并通过正确实施、配置安全性,避免虚拟机蔓延等多方面技巧,最终在充分保证虚拟机性能优化的同时,合理控制运营成本。
VMware已经建立了一个合作伙伴列表,该列表中的厂商将提供EVO:RAIL的硬件部分。尽管底层的技术相同,但HP、Dell以及合作伙伴列表上的其他厂商提供的产品还是有一些差异。
在VMworld 2013上,VMware发布了它的下一代网络虚拟化平台NSX,两年过去了,VMware NSX有了哪些变化?您是否已经部署VMware NSX?
虽然vSphere 6要等到2015年初才会发布,但是大家对它的热情不减。相信很多企业都已经在使用vSphere,本期技术手册分享一些关于vSphere的高级技巧,例如如何重新设计vSphere让其发挥最大潜力。
TechTarget
企业级IT网站群
TechTarget中国 版权所有
All Rights Reserved, Copyright
TechTarget中国 版权所有
All Rights Reserved, Copyright你的位置: >
> XenServer 丢失 SR
重新挂载方案
重做Xenserver 导致 SR丢失,内有VPS数据,采用EXT存储,通过扫描出 vg name后,直接原地挂载回。
记住需要恢复的PV名,如结果为 VG XSLocalEXT-b0023317-af8e-3de4-f86d-c2c49cb6e077,则记录下b0023317-af8e-3de4-f86d-c2c49cb6e077。
二、重新挂载回SR
xe sr-introduce uuid=b0023317-af8e-3de4-f86d-c2c49cb6e077 type=ext name-label=”sdb” content-type=user
如果是lvm,则把type改下。
三、获得主机uuid
xe host-list
把uuid记下,如c43fdaed-2c25-40e6-a5fb-f1d9f010b313
四、获得硬盘
ls -l /dev/disk/by-id/
记得要恢复的硬盘scsi-SATA_####################480FGN部分。
xe pbd-create sr-uuid=b0023317-af8e-3de4-f86d-c2c49cb6e077 device-config:device=/dev/disk/by-id/scsi-SATA_####################480FGN host-uuid=c43fdaed-2c25-40e6-a5fb-f1d9f010b313
填入sr uuid 和 硬盘by-id,还有host-uuid即可,就会返回一串pbd的UUID如b7eb7e4c-6ed5-ba6f-46d7-bec384a0b90c,然后填入。
xe pbd-plug uuid=b7eb7e4c-6ed5-ba6f-46d7-bec384a0b90c
转载请注明: &
与本文相关的文章

我要回帖

更多关于 xenserver new sr 的文章

 

随机推荐