[sheepdog-users] sheepdog about clone

Liu Yuan namei.unix at gmail.com
Fri May 16 05:20:07 CEST 2014


On Thu, May 15, 2014 at 04:08:08PM +0200, Valerio Pachera wrote:
> 2014-05-13 9:18 GMT+02:00 飞 <duron800 at qq.com>:
> 
> > hello, I have a question for clone a sheepdong image.
> > my clone steps are:
> > 1. I create a image named myimg
> > 2. I write some files to  myimg
> > 3. I create a snapshot named 'newest', dog vdi snapshot -s newest myimg
> > 4. I ran 'dog vdi clone -s newest myimg myimg2'
> > 5. I ran 'dog vdi delete myimg'
> > 6. I attach the myimg2 to QEMU, but I can't found the files I wrote at
> > step 2.
> >
> 
> I confirm such behaviour.
> (I'm running latest master branch 'Sheepdog daemon version
> 0.8.0_152_g65dde97').
> 
> More precisely it happens if the snapshot is taken with the running guest.
> I created 250 files of 1M each inside the guest and run 'dog vdi snapshot'
> as soon as dd was done.
> I turned off the guest; cloned the snapshot and run the guest from the
> cloned vdi.
> The guest was showing all 250 file but many of them were empty!
> Also bash history was not saved.
> 
> If I do the same thing but shutting down the guest before taking the
> snapshot, then all data is present on the cloned vdi (bash history
> included).
> 
> Is it possible to force sheepdog to send a 'sync' request when taking the
> snapshot?

Linux kernel provide a mechanism for safe snapshot of file system, man fsfreeze(8).

So the right steps is:

1 guest kernel execute fsfreeze(8)
2 take a live snapshot, either by qemu-img or dog.
3 guest kernel thaw the file system by 'fsfreeze -u'

I think QEMU has some mechanisms to trigger the command execution inside the
guest from outside world.

It's welcome for someone can hook fsfreeze into 'dog vdi snapshot'.

Thanks
Yuan



More information about the sheepdog-users mailing list