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 -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。同时测试服务是否中断。
阅读(1563) | 评论(0) | 转发(0) |