qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] qemu-img:the sheepdog snapshot vdi's lock will not be released when use qemu-img to create a snapshot vdi
@ 2014-12-22  9:41 徐小龙
  2014-12-24 14:47 ` Hitoshi Mitake
  0 siblings, 1 reply; 3+ messages in thread
From: 徐小龙 @ 2014-12-22  9:41 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, Hitoshi Mitake, morita.kazutaka, namei.unix

[-- Attachment #1: Type: text/plain, Size: 1705 bytes --]

hi,all,
     when i use `qemu-img snapshot -c test-s sheepdog:test` to create a
snapshot of sheepdog vdi,the snapshot's lock not be released.

root@hty-compute1:~/qemu# ./qemu-img create sheepdog:test 1G
Formatting 'sheepdog:test', fmt=raw size=1073741824

root@hty-compute1:~/qemu# dog vdi list
  Name        Id    Size    Used  Shared    Creation time   VDI id  Copies
 Tag
  test         0  1.0 GB  0.0 MB  0.0 MB 2014-12-22 17:10   7c2b25      3

root@hty-compute1:~/qemu# ./qemu-img snapshot -c test-s sheepdog:test
WARNING: Image format was not specified for 'sheepdog:test' and probing
guessed raw.
         Automatically detecting the format is dangerous for raw images,
write operations on block 0 will be restricted.
         Specify the 'raw' format explicitly to remove the restrictions.

root@hty-compute1:~/qemu# dog vdi lock list
VDI | Owner node | Tag
s test | IPv4 ip:172.16.17.200 port:7000 test-s

when i create a snapshot ,the src vdi will be open and locked,in the
function `sd_open` read the vdi inode info saved in the struct
BDRVSheepdogState ,and in the function `sd_snapshot_create` the vdi inode
information in the struct BDRVSheepdogState will point to an new vdi ,so
when the function `sd_close` be called,the `sd_close` will try to released
the lock of new vdi.In conclusion,the snapshot vdi will lock forever , so
it's will be failed when i try to create a new vdi base on the snapshot.

root@hty-compute1:~/qemu# ./qemu-img create -b sheepdog:test:test-s
sheepdog:new-vdi
qemu-img: sheepdog:new-vdi: cannot get vdi info, VDI is already locked,
test 0 test-s

There may be some wrong in the function`sd_snapshot_create`.but I'm not
sure the root cause.

Thanks,
Xiaolong Xu

[-- Attachment #2: Type: text/html, Size: 2223 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] qemu-img:the sheepdog snapshot vdi's lock will not be released when use qemu-img to create a snapshot vdi
  2014-12-22  9:41 [Qemu-devel] qemu-img:the sheepdog snapshot vdi's lock will not be released when use qemu-img to create a snapshot vdi 徐小龙
@ 2014-12-24 14:47 ` Hitoshi Mitake
  2014-12-25 14:03   ` long
  0 siblings, 1 reply; 3+ messages in thread
From: Hitoshi Mitake @ 2014-12-24 14:47 UTC (permalink / raw)
  To: =?ISO-2022-JP-2?B?GyRCPXk+LhskQUF6GyhC?=
  Cc: kwolf, Hitoshi Mitake, morita.kazutaka, qemu-devel, namei.unix

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=ISO-2022-JP-2, Size: 2001 bytes --]

At Mon, 22 Dec 2014 17:41:33 +0800,
^[$B=y>.^[$AAz^[(B wrote:
> 
> [1  <text/plain; UTF-8 (7bit)>]
> hi,all,
>      when i use `qemu-img snapshot -c test-s sheepdog:test` to create a
> snapshot of sheepdog vdi,the snapshot's lock not be released.
> 
> root@hty-compute1:~/qemu# ./qemu-img create sheepdog:test 1G
> Formatting 'sheepdog:test', fmt=raw size=1073741824
> 
> root@hty-compute1:~/qemu# dog vdi list
>   Name        Id    Size    Used  Shared    Creation time   VDI id  Copies
>  Tag
>   test         0  1.0 GB  0.0 MB  0.0 MB 2014-12-22 17:10   7c2b25      3
> 
> root@hty-compute1:~/qemu# ./qemu-img snapshot -c test-s sheepdog:test
> WARNING: Image format was not specified for 'sheepdog:test' and probing
> guessed raw.
>          Automatically detecting the format is dangerous for raw images,
> write operations on block 0 will be restricted.
>          Specify the 'raw' format explicitly to remove the restrictions.
> 
> root@hty-compute1:~/qemu# dog vdi lock list
> VDI | Owner node | Tag
> s test | IPv4 ip:172.16.17.200 port:7000 test-s
> 
> when i create a snapshot ,the src vdi will be open and locked,in the
> function `sd_open` read the vdi inode info saved in the struct
> BDRVSheepdogState ,and in the function `sd_snapshot_create` the vdi inode
> information in the struct BDRVSheepdogState will point to an new vdi ,so
> when the function `sd_close` be called,the `sd_close` will try to released
> the lock of new vdi.In conclusion,the snapshot vdi will lock forever , so
> it's will be failed when i try to create a new vdi base on the snapshot.
> 
> root@hty-compute1:~/qemu# ./qemu-img create -b sheepdog:test:test-s
> sheepdog:new-vdi
> qemu-img: sheepdog:new-vdi: cannot get vdi info, VDI is already locked,
> test 0 test-s
> 
> There may be some wrong in the function`sd_snapshot_create`.but I'm not
> sure the root cause.
> 
> Thanks,
> Xiaolong Xu

Xiaolong, thanks for your report. I'll fix it ASAP.

Could you use the dog command as a walkaround?

Thanks,
Hitoshi

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] qemu-img:the sheepdog snapshot vdi's lock will not be released when use qemu-img to create a snapshot vdi
  2014-12-24 14:47 ` Hitoshi Mitake
@ 2014-12-25 14:03   ` long
  0 siblings, 0 replies; 3+ messages in thread
From: long @ 2014-12-25 14:03 UTC (permalink / raw)
  To: Hitoshi Mitake
  Cc: kwolf, Hitoshi Mitake, morita.kazutaka, qemu-devel, namei.unix

[-- Attachment #1: Type: text/plain, Size: 2609 bytes --]

ok,thank you for your reply, but now the openstack cinder use both qemu-img and dog command,so  the recreate vdi from snapshot futrue has some problem.

https://github.com/openstack/cinder/blob/98706a9804d5896546cac0c565f74ec6cf0f24b9/cinder/volume/drivers/sheepdog.py <https://github.com/openstack/cinder/blob/98706a9804d5896546cac0c565f74ec6cf0f24b9/cinder/volume/drivers/sheepdog.py>


Thanks,
Xiaolong Xu

> 在 2014年12月24日,下午10:47,Hitoshi Mitake <mitake.hitoshi@gmail.com> 写道:
> 
> At Mon, 22 Dec 2014 17:41:33 +0800,
> 徐小龙 wrote:
>> 
>> [1  <text/plain; UTF-8 (7bit)>]
>> hi,all,
>>     when i use `qemu-img snapshot -c test-s sheepdog:test` to create a
>> snapshot of sheepdog vdi,the snapshot's lock not be released.
>> 
>> root@hty-compute1:~/qemu# ./qemu-img create sheepdog:test 1G
>> Formatting 'sheepdog:test', fmt=raw size=1073741824
>> 
>> root@hty-compute1:~/qemu# dog vdi list
>>  Name        Id    Size    Used  Shared    Creation time   VDI id  Copies
>> Tag
>>  test         0  1.0 GB  0.0 MB  0.0 MB 2014-12-22 17:10   7c2b25      3
>> 
>> root@hty-compute1:~/qemu# ./qemu-img snapshot -c test-s sheepdog:test
>> WARNING: Image format was not specified for 'sheepdog:test' and probing
>> guessed raw.
>>         Automatically detecting the format is dangerous for raw images,
>> write operations on block 0 will be restricted.
>>         Specify the 'raw' format explicitly to remove the restrictions.
>> 
>> root@hty-compute1:~/qemu# dog vdi lock list
>> VDI | Owner node | Tag
>> s test | IPv4 ip:172.16.17.200 port:7000 test-s
>> 
>> when i create a snapshot ,the src vdi will be open and locked,in the
>> function `sd_open` read the vdi inode info saved in the struct
>> BDRVSheepdogState ,and in the function `sd_snapshot_create` the vdi inode
>> information in the struct BDRVSheepdogState will point to an new vdi ,so
>> when the function `sd_close` be called,the `sd_close` will try to released
>> the lock of new vdi.In conclusion,the snapshot vdi will lock forever , so
>> it's will be failed when i try to create a new vdi base on the snapshot.
>> 
>> root@hty-compute1:~/qemu# ./qemu-img create -b sheepdog:test:test-s
>> sheepdog:new-vdi
>> qemu-img: sheepdog:new-vdi: cannot get vdi info, VDI is already locked,
>> test 0 test-s
>> 
>> There may be some wrong in the function`sd_snapshot_create`.but I'm not
>> sure the root cause.
>> 
>> Thanks,
>> Xiaolong Xu
> 
> Xiaolong, thanks for your report. I'll fix it ASAP.
> 
> Could you use the dog command as a walkaround?
> 
> Thanks,
> Hitoshi
> 


[-- Attachment #2: Type: text/html, Size: 4018 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-12-25 14:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-22  9:41 [Qemu-devel] qemu-img:the sheepdog snapshot vdi's lock will not be released when use qemu-img to create a snapshot vdi 徐小龙
2014-12-24 14:47 ` Hitoshi Mitake
2014-12-25 14:03   ` long

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).