Citrix XenCenter安装VM详解

来源:互联网 发布:郑州大数据培训 编辑:程序博客网 时间:2024/05/22 07:47

       最近在VMware7.0上装了个Citrix XenServer。

       Citrix XenServer 是企业级面向云计算的虚拟平台,有 XenServer, Essentials for XenServer, Enterprise Edition 和 Platinum Edition 三种版本,其中 XenServer 是免费的,和 VMware ESXi 是同级别的竞争产品。XenServer 的安装过程和 VMware ESX4.0 一样容易,安装完后界面如下。和 VMware ESX4.0 类似,主要的操作和配置都可以在一个另外一台装有 XenCenter 客户端的机器上完成(和 VMware vShpere Client 一样)。

       和VMware ESX4.0有点不同的是,XenServer 不能在XenCenter 客户端管理界面里直接导入iso 后安装操作系统,需要先把这些iso预存到另一台机器上,然后用NFS 的方式访问。所以我们先在其他的机器开设一个is 目录并收集一些iso文件,用NFS 导出这个iso 目录,然后在XenServer 服务器上手动把这个目录挂上,这样才能在XenServer 和 XenCenter 管理界面里看到所有的iso 文件,也就是说XenServer 鼓励你把 iso 文件分开存储到另外一台单独服务器以方便管理。

接下来我们在Ubuntu上配置NFS:

    安装nfs:#sudo apt-get install nfs-kernel-server

 打开/etc/exports文件,在末尾加入:
  /home/iso *(rw,sync,no_root_squash)
  注:nfs允许挂载的目录及权限,在文件/etc/exports中进行定义, 各字段含义如下:
  /home/iso:要共享的目录
  * :允许所有的网段访问
  rw :读写权限
  sync:资料同步写入内在和硬盘
  no_root_squash:nfs客户端共享目录使用者权限

  重启服务:
  #sudo /etc/init.d/portmap restart                           <---重启portmap,很重要
  #sudo /etc/init.d/nfs-kernel-server restart           <---重启nfs服务
  #showmount -e                                                        <---显示共享出的目录

  注:nfs是一个RPC程序,使用它前,需要映射好端口,通过portmap设定
  命令执行情况如下:
  xgc@xgc-VirtualBox:~$ sudo /etc/init.d/portmap restart
  Rather than invoking init scripts through /etc/init.d, use the service(8)
  utility, e.g. service portmap restart
  Since the script you are attempting to invoke has been converted to an
  Upstart job, you may also use the restart(8) utility, e.g. restart portmap
  portmap start/running, process 474
  xgc@xgc-VirtualBox:~$ sudo /etc/init.d/nfs-kernel-server restart
  * Stopping NFS kernel daemon [ OK ]
  * Unexporting directories for NFS kernel daemon... [ OK ]
  * Exporting directories for NFS kernel daemon...
  exportfs: /etc/exports [1]: Neither 'subtree_check' or 'no_subtree_check' specified for export "*:/home/xgc".
  Assuming default behaviour ('no_subtree_check').
  NOTE: this default has changed since nfs-utils version 1.0.x [ OK ]
  * Starting NFS kernel daemon [ OK ]
  xgc@xgc-VirtualBox:~$ showmount -e
  Export list for xgc-VirtualBox:
  /home/iso *

  现在可以在本机上试一下:
  #sudo mount -t nfs localhost:/home/xgc /mnt
  注:localhost为本机linux的IP地址
  这样就把共享目录挂到了/mnt目录,取消挂载用:
  #sudo umount /mnt
  如果用在嵌入式设备上挂载,要加上参数-o nolock

注:为Ubuntu NFS服务系统设置IP(192.168.10.44)。

到此装在Ubuntu上的NFS服务安装配置完成,在/home/iso目录下统一管理所有系统镜像iso文件。

 

下来在Citrix XenCenter上用ISO安装虚拟机系统:

一、首先我们得准备一台NFS共享服务器(就是上边的Ubuntu),IP地址192.168.10.*,用于存放linux.iso镜像文件,然后做一个NFS共享。

/home/iso  192.168.10.44(rw,insecure,sync,all_squash)

启动相关服务。关于NFS请参考:

linux下设置目录同步NFS

 

二、连接上XenServer 服务器:xenserver-axrngkqr。

三、新建一个存储仓库(New Storage Repository),用于存放linux.iso文件。

 

 或者在Console:

[root@xenserver-axrngkqr ~]# xe-mount-iso-sr 192.168.10.44:/home/flc/iso

四、安装虚拟操作系统(New VM) Linux。

五、进入控制台安装Linux系统