Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1303202
  • 博文数量: 416
  • 博客积分: 10495
  • 博客等级: 上将
  • 技术积分: 4258
  • 用 户 组: 普通用户
  • 注册时间: 2005-04-23 22:13
文章分类

全部博文(416)

文章存档

2015年(7)

2014年(42)

2013年(35)

2012年(14)

2011年(17)

2010年(10)

2009年(18)

2008年(127)

2007年(72)

2006年(23)

2005年(51)

分类: 虚拟化

2014-05-04 15:53:17

1. 使用virt-manager管理多台机器(此步骤可以不做)
  在一台机器上的virt-manager可以通过add connection管理其它机器上的虚拟机,一般通过"remote tunnel over ssh"就可以了,前提是建立SSH连接,为了简单起见,最好配置密钥证书认证模式,采用无密码登录。简单配置如下:
$ ssh-keygen -t rsa #产生SSH公钥及私钥
$ ssh-copy-id -i ~/.ssh/id_rsa.pub root@somehost #拷贝公钥到需要管理的机器上
$ ssh root@somehost #登录到该台机器启动libvirtd服务
# chkconfig libvirtd on
# service libvirtd start
2.迁移虚拟机,必须要在各个宿主机之间配置共享目录,在virt-manager中称为"Storage Pool",即存储池,可以通过NFS等共享。在virt-manager界面中点击主机详细信息,有三个tab,即overview, virtual networks, storage。这个storage就是配置存储池的地方。具体配置方法比较简单,可以参考文档。

3. 如果是迁移xen,必须要重新配置某些选项,然后重启xend服务。

[root@host1 ~]# vi /etc/xen/xend-config.sxp

(xend-relocation-server yes)

(xend-relocation-port 8002)

(xend-relocation-address '')

(xend-relocation-hosts-allow '')

     * xend-relocation-server yes

       "yes" 代表要启动 Relocation 的服务

     * xend-relocation-port 8002

       Relocation 所使用的 TCP port 预设为 8002

      * xend-relocation-address ''

       定义哪些 IP address 执行 relocation 服务,预设为空白表示本机的所有 IP,所以 Host1 以及 Host2 请保持空白就可以.当我们系统有多个 port 时可以限制对外的 port 不能使用这个服务.通常遇到这错误的讯息  "Error: Unable to connect to xend: Connection refused. Is xend running?"  就代表目前这 IP address 不在允许范围内

     * xend-relocation-hosts-allow ''

       定义哪些 Host 可以将 Virtual Machine 转换到这一台 Host 上面,以我们的范例只需要将 Host2 做设定即可.设定可为 IP 或是 FQDN (只要是能解析的都可以).预设为空白也就是接受所有转换的要求.

 

设定完毕请将 Host1 以及 Host2 重新启动 Xend 的服务

[root@host1 ~]# service xend restart

[root@host2 ~]# service xend restart


转自:http://chyd96.blog.163.com/blog/static/6270607620105284384468/

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