分享

使用virt

 浸心阁 2015-07-30
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就是配置存储池的地方。具体配置方法比较简单,可以参考文档。http://www./docs/en-US/Red_Hat_Enterprise_Linux/5.4/html/Virtualization_Guide/sect-Virtualization-KVM_live_migration-Migrating_with_virt_manager.html

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

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多