在线迁移中tapdisk2读取的数据不一致问题

Question:

 

given that vm migrates from host A to host B, which image is vhd file.
 
in host B, it first creates devices including starting tapdisk2 process, at this time, tapdisk2 will read some metadata of vhd file. then, it xc_restore
 
in host A, before it start last iteration(stop-and-copy phase), while xc_save's going, vhd file has been changed including metadata. So, in hostB tapdisk2 process doesn't read the
 
newest metadata of vhd file.
 
for tapdisk2, when it starts, it will read footer, header, bat of vhd file. especially bat structure, if it's inconsistent, it'll cause problem.

 

Solution:

 

Options:

A. Avoid VBD lifetime overlap. This is how XCP presently does it. XCP
has vdi.activate/deactivate operations in addition to attach/detach to
control storage during migration.

Attach/detach is the same as described above. It may be desired as the
preferred transfer method on non-shared storage nodes to avoid latency
in stop/copy.

The simpler way is of course activate/deactivate semantics everywhere,
which is mutually exclusive.

This is needed for any indirectly mapped disk format (vhd, qcow? etc) on
shared physical nodes.

Not that this doesn't only matter for metadata. There are physical
layers where exclusive login is preferred/mandatory, so you won't even
get access to the device before pre-copy is done and the node could be
released on A.

Diagram:

Node            A                                 B

VM.migrate      .. pre-copy >  < stop-and-copy >  <resumed ...

VDI.attached    ..------------A--------------->
                           <-----------B-------------------..

VDI.active     -----------A---->           <----B-------..

B. Hack.
  Let the toolstack issue a tap-ctl pause/unpause cycle before resume.
  This will reopen the image.

C. Back then, in the dark ages, blktap did this implicitly.
  Every first I/O request after disk create run an implicit close/open
  cycle on the physical image.

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值