Hi,<br><br><div class="gmail_quote">2011年6月21日7:52 Eric Blake <span dir="ltr"><<a href="mailto:eblake@redhat.com">eblake@redhat.com</a>></span>:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br><div class="im">
><br>
> For LVM, it may be lvconvert --merge , but requires recent version of lvm<br>
> and linux kernel,<br>
> So, there are some failure reason (toolchain doesn't support it or toolchain<br>
> supports, but failed)<br>
> I don't know how to handle these case for now, but we may need to add some<br>
> virErrorNumber<br>
> to indicate snapshot-related error.<br>
<br>
</div>Yes, we can add new virError values as we come across situations where<br>
such operations are unsupported, but which don't fit well into any<br>
existing error values.<br></blockquote><div><br>I understand.<br> <br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im"><br>
>> virStorageVolSnapshotCreateXML.  [And since my first phase of<br>
>> implementation will be focused on inline qcow2 snapshots, I don't yet<br>
>> know what that XML will need to contain for any other type of snapshots,<br>
>> such as mapping out how the snapshot backing file will be named in<br>
>> relation to the possibly new live file.]<br>
>><br>
><br>
> In LVM case, taking snapshot(lvcreate)  needs at least snapshot volume size<br>
> as an argument,<br>
> So, I think storage-specific element can be inserted in this XML format<br>
<br>
</div>Wouldn't the snapshot volume size always be equal to the volume size of<br>
the original?  Or is there really value in allowing the snapshot size to<br>
be configured to something different (and if different, must it always<br>
be <= original, or does a larger snapshot than the original make sense)?<br><div class="im"></div></blockquote><div><br>My concern senario is <br><br>1.  creaing a snapshot through libvirt, <br>2.  take a backup from snapshot, <br>
3.  remove a snapshot.<br><br>case.<br><br>In this case, I think sys-admin may want to create a snapshot size  smaller than original size.<br>But this senario seems to make another problem (snapshot becomes invalid, described below).<br>
so assuming that the snapshot volume size always be equal to the volume size of<br>
the original is better for us.<br><br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im">
>> Any feedback on this approach?  Any other APIs that would be useful to<br>
>> add?  I'd like to get all the new APIs in place for 0.9.3 with minimal<br>
>> qcow2 functionality, then use the time before 0.9.4 to further enhance<br>
>> the APIs to cover more snapshot cases but without having to add any new<br>
>> APIs.<br>
>><br>
><br>
> LVM snapshot may become invalid in the case of running out the volume size,<br>
> So, adding an  API for checking whether snapshot is valid will be needed.<br>
<br>
</div>I'm not quite sure I follow the scenario you are envisioning here.<br>
Would you mind stepping through an example (mapping [proposed] libvirt<br>
API calls to lvm commands would be helpful), on how an original lvm<br>
partition is created, then a snapshot partition, then how you run out of<br>
volume size in that snapshot?  It sounds like you are saying that there<br>
is a way to create an lvm snapshot that is valid at the time that is<br>
created, but later on, subsequent actions cause the snapshot to run out<br>
of space and no longer be valid.  But my understanding is that a<br>
snapshot is a constant size (it represents a known state of the disk at<br>
a fixed point in time), only the deltas to that snapshot (aka the live<br>
disk) ever have the potential to grow beyond the amount of storage used<br>
by the snapshot.  Or are you worried about creating an lvm snapshot by<br>
libvirt, but then a third party program changes the property of the lvm<br>
snapshot volume to change its size?<br><br></blockquote><div><br>I worried about the case I mensioned above (snapshot size is smaller case)<br><br><br>Regards,<br> </div></div><br>