Chinaunix首页 | 论坛 | 博客
  • 博客访问: 515715
  • 博文数量: 93
  • 博客积分: 2479
  • 博客等级: 大尉
  • 技术积分: 1008
  • 用 户 组: 普通用户
  • 注册时间: 2007-11-07 11:59
文章分类

全部博文(93)

文章存档

2012年(2)

2011年(41)

2010年(24)

2009年(21)

2008年(5)

分类: 虚拟化

2011-07-15 09:34:46

由于xenserver空间有限,所以通过挂载nfs服务器上的iso文件来实现.

1.       Nfs服务器的实现(192.168.1.222

a)         安装nfs: Yum install nfs-*

b)         配置: /etc/exports          /opt/iso   192.168.1.*(rw,sync)

允许所有192.168.1.*范围内的主机来分享/opt/iso里的文件

Exports文件的格式:

Nfs共享的目录  主机名称或IP(参数)

其中参数有以下选项:

Ro:  只读的权限;

rw:可读写的权限;

no_root_squash:登入到NFS主机的用户如果是ROOT用户,他就拥有ROOT的权限,此参数很不安全,建议不要使用。

Root_squash: 登入nfs主机的用户都设定为anonymous uid/gid.

all_squash:不管登陆NFS主机的用户是什么都会被重新设定为nobody

anonuid:将登入NFS主机的用户都设定成指定的user id,ID必须存在于/etc/passwd中。

anongid:同 anonuid ,但是? group ID 就是了!
sync
:资料同步写入存储器中。
async
:资料会先暂时存放在内存中,不会直接写入硬盘。
insecure
允许从这台机器过来的非授权访问。

c)         启动服务:

                         i.              Service portmap start

                       ii.              Service nfs start

d)         修改exports文件后,可执行: exportfs –rv   相当于重新export一次

e)         御载: exportfs –au

f)          相关命令:

Rpcinfo –p (确认服务成功运行)

Exportfs 检查 NFS 服务器是否输出我们想共享的目录

2.       Xenserver(nfs客户端)配置

a)         Ssh登录到xenserver

b)         xe-mount-iso-sr 192.168.1.222:/opt/iso

c)         成功挂载后,就应在xencenter上看到挂载的ISO.

d)        

3.       遇到问题:

mount clntudp_create: RPC: Program not registered

解决方法: 可能是nfs服务未正常启动,可尝试: rpc.mountd

4.  官方文档

To use local ISO storage from the control domain

1.     Log onto the host console.

2.     Create a directory to copy the local ISOs into:

mkdir -p /var/opt/xen/iso_import

3.     Create an ISO storage repository by:

4. xe sr-create name-label=<name> type=iso \

5. device-config:location=/var/opt/xen/iso_import/<name> \

device-config:legacy_mode=true content-type=iso

6.     Copy the ISO images into this directory, taking care not to fill up the control domain filesystem.

7.     Verify that the ISO image is available for use by xe vdi-list, or checking the CD drop-down box in XenCenter.

Warning

Be extremely careful with copying ISOs directly onto the control domain filesystem, as it has limited space available. A network share is a much safer mechanism for storing large numbers of ISO images. If the control domain does fill up, unpredictable behavior will result.

网友观点:

问:在XenCenter里没有看到ISOs挂载点,怎么办?

答:

1. xe sr-create name-label=ISOs type=iso device-config:location=/var/opt/xen/iso_import device-config:legacy_mode=true content-type=iso

2. xe-mount-iso-sr /var/opt/xen/iso_import

 

***********************************************

xenserver故障解决

现象:

所有虚拟机无法启动,报如下错误:

 解决方法:

 登陆xenserver:

执行  xe-toolstack-restart 即可. 

阅读(1523) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~