免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1374 | 回复: 0
打印 上一主题 下一主题

动态迁移一台基于NFS共享存储的PV虚拟机 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-11-19 13:10 |只看该作者 |倒序浏览

1 在NFS的服务器配置
网络环境 192.168.0.128/24
[root@localhost ~]# mkdir /virtual;cd /virtual/
[root@localhost virtual]#dd if=/dev/zero of=./storage.img bs=1M count=8192
[root@localhost virtual]# chmod 666 storage.img
[root@localhost virtual]# vi /etc/exports /virtual 192.168.0.0/24(rw)
[root@localhost virtual]# service portmap restart
Stopping portmap:                                          [  OK  ]
Starting portmap:                                          [  OK  ]
[root@localhost virtual]# service nfs restart
Shutting down NFS mountd:                                  [  OK  ]
Shutting down NFS daemon:                                  [  OK  ]
Shutting down NFS quotas:                                  [  OK  ]
Shutting down NFS services:                                [  OK  ]
Starting NFS services:                                     [  OK  ]
Starting NFS quotas:                                       [  OK  ]
Starting NFS daemon:                                       [  OK  ]
Starting NFS mountd:                                       [  OK  ]

[root@localhost virtual]# exportfs
/virtual 192.168.0.0/24

2 客户端一
网络环境 192.168.0.136/24
在此机器上建立一个PV,将该PV迁移到客户端二上
(1)将NFS服务器上的目录挂载到本地

# mount 192.168.0.128:/virtual/ /virtual/
(2)建立PV


#virt-install -p -n forMig -f /virtual/storage.img -r 256 -l http://192.168.0.254/rhel54 -w bridge:xenbr0


(3)修改#vi /etc/xen/xend-config.sxp
(xend-relocation-server yes)
/* A boolean value that tells xend whether or not to start the relocation server.  This is required for cross-machine migrations.Defaults to no.*/

(xend-relocation-address '')
/* The address to which the relocation server will bind.  Defaults to  which means "all interfaces".*/

(xend-relocation-hosts-allow '')

3 客户端二
网络环境 192.168.0.191/24
(1)将NFS服务器上的目录挂载到本地


# mount 192.168.0.128:/virtual/ /virtual/
(2)修改#vi /etc/xen/xend-config.sxp
(xend-relocation-server yes)
(xend-relocation-address '')
(xend-relocation-hosts-allow '')
4 测试

#xm migrate --live 12 192.168.0.191

12是forMig的domain-id
运行这条命令后,在客户端二中打开virt-manager。发现已经出现了forMig这个PV,其domain-id为22。实验成功。

    在实现泛虚拟化(Para-virtualizition)的Live迁移时,一定要保证三点:
       1。Same share storage;Domain's VBDs must be visible to all.
       2。Same network ;the same link and sub net
       3。Same CPU's architecture ;
做实验的时候可以开启某个服务,如Apache。同时测试服务是否中断。

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u3/104843/showart_2098266.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP