virtualization--storage migration

原文网址:http://www.server-world.info/en/note?os=CentOS_6&p=kvm&f=14

This is the example to use Storage Migration function for virtual machines.
本节演示了虚拟机存储迁移功能。

The different point of Storage Migration from Live Migration is that Storage Migration does not need a Storage server which has virtual machine images, when executing

存储迁移与在线迁移的不同点是:当执行迁移时,存储迁移不需要有一个存有虚拟机镜像的存储服务器。


Storage Migration, virtual machine image on a KVM host is migrated on another KVM host like follows.

存储迁移,将一台KVM主机上的虚拟机镜像迁移到另一台KVM主机上,如下图示:

         Storage Migration
                        <------------------->
                        
+----------------------+                     +----------------------+
|  [   KVM Host #1  ]  |10.0.0.21   10.0.0.22|  [  KVM Host #2   ]  |
|                      +---------------------+                      |
|  kvm01.server.world  |                     |  kvm02.server.world  |
+----------------------+                     +----------------------+

1、Create a virtual machine on a KVM host.

在一个KVM主机上创建一个虚拟机镜像。


2、Show the file size of a virtual machine image like follows on a KVM host and move to another KVM host, create a empty disk space like follows.

按如下方式,在一个KVM主机上显示要迁移到另一个KVM主机上的虚拟机镜像文件的大小,按如下方式创建一个空磁盘空间。

# show the size of Virtual machine

[root@kvm01 ~]# ll /var/kvm/images
total 846468
-rwxr-xr-x 1 root root 32212254720 Aug  6 22:00 centos.img

### on another KVM host ###
# create a disk space which is the same size of a virtula machine
[root@kvm02 ~]#fallocate -l 32212254720 /var/kvm/images/centos.img
[root@kvm02 ~]# ll /var/kvm/images
total 31457284
-rw-r--r-- 1 root root 32212254720 Aug  6 22:10 centos.img 

3、It's OK all, execute Storage Migration like follows.

一切正常运行后,按如下方式执行存储器迁移:

[root@kvm01 ~]#virsh list

 Id    Name             State
--------------------------------------
 2     centos           running

[root@kvm01 ~]#virsh migrate --live --copy-storage-all centos qemu+ssh://10.0.0.22/system
root@10.0.0.22's password:
[root@kvm01 ~]#virsh list
 Id    Name             State
--------------------------------------
 
# just migrated
### on another KVM host ###

[root@kvm02 ~]#virsh list
 Id    Name              State
---------------------------------------
 1     centos            running

# back to another host, it's OK to execute normal Live Migration

[root@kvm02 ~]#virsh migrate --live centos qemu+ssh://10.0.0.21/system
root@10.0.0.21's password:
[root@kvm02 ~]#virsh list
 Id    Name             State
--------------------------------------


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值