[Devel] Patch for vzctl reinstall

Pavel Odintsov pavel.odintsov at gmail.com
Sat Nov 29 05:00:05 PST 2014


Yep, merge all snapshots and re-create filesystem is a best approach.
But it need bigger patch then "destroy and create" version because I
use standard code from vzctl.

On Sat, Nov 29, 2014 at 3:52 PM, Kevin Holly [Fusl]
<openvz at lists.dedilink.eu> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi Pavel,
>
> then, the only thing which comes into my mind again is just to destroy
> the partition table (ploop mount the root.hdd to /dev/ploopXXX..., run
> parted -s /dev/sdb 'mklabel gpt'), then mount the /dev/ploopXXX to
> /vz/root/<CTID>/, extract the .tar.gz there and umount everything.
>
> But(!) I'm not pretty sure if this also destroys/breaks snapshots or
> not. Has to be tested first ofc :)
>
> On 11/29/2014 09:31 AM, Pavel Odintsov wrote:
>> Hello, Kevin!
>>
>> Thank you for your feedback!
>>
>> We selected this approach because rm -rf on /vz/root/CTID/* can
>> consume big amount of time due to "millions of files" inside
>> image.
>>
>> From VPS provider side is very important provide to ability to
>> customer for fast container reinstall and we did it. But we did
>> backup after any reinstall operation (on ploop level too) for fast
>> restore in emergency case.
>>
>> On Sat, Nov 29, 2014 at 4:29 AM, Kevin Holly [Fusl]
>> <openvz at lists.dedilink.eu> wrote: Hi Pavel,
>>
>> you really want to destroy a containers private directory on
>> reinstall? Think about snapshots, they are stored in the private
>> directory! For example, I want to snapshot a container, reinstall
>> it for testing things and then want to restore a previous snapshot
>> because the thing I wanted to test did not work.
>>
>> It would be better to just mount the filesystem of the container,
>> delete the content within it and extract the .tar.gz file into it.
>> Instead of deleting the content, you could also just mount the
>> ploop device to /dev/ploopXXX, remove the partition and recreate
>> it, then mount and extract the .tar.gz file.
>>
>> On 11/28/2014 08:28 PM, Pavel Odintsov wrote:
>>>>> Hello, folks!
>>>>>
>>>>> Please take a look on my patch for vzctl reinstall ability.
>>>>> It's very useful because reinstalling of already created
>>>>> ploop container is a real pain.
>>>>>
>>>>> Thank you!
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________ Devel mailing
>>>>> list Devel at openvz.org
>>>>> https://lists.openvz.org/mailman/listinfo/devel
>>>>>
>>
>>> _______________________________________________ Devel mailing
>>> list Devel at openvz.org
>>> https://lists.openvz.org/mailman/listinfo/devel
>>
>>
>>
>
> - --
> Best regards
>
> Kevin Holly - root at hallowe.lt - http://hallowe.lt/
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2.0.22 (GNU/Linux)
>
> iQEcBAEBAgAGBQJUecGkAAoJELAaqP3QtzpMXE0IAIs4/yRJOWT95NdCVPDVf/Nh
> lqv5aYdwjxjcYc3dDHTf6q+wPjbMJvH4gx5OsUvpsUmpkQvEvt/tfPOAZIh3ClOk
> dypAAsbjagI0vY9IMzKhu4/TYXhoe/lShyMHtLxTkLQVbNqxNOsPmFimZZoRkYA6
> wdjVHr/8otH0atylb4UzEgi7hvKG+gNE7zkFtAQudDAOdPQ0Uy9r8DxcHTgWn3Lo
> 7vqdr3VnOpNvLBsC00BinBZdaURC7hTYJdv8moHxEpoYD/QsWWo+uR18LtQHGwL/
> ZgF17ofsptfYzQyJryS07RBQLxDTdbBbhFc1f74OzUKR0/y7ieVM1jBMYWGV5oA=
> =CyRn
> -----END PGP SIGNATURE-----
> _______________________________________________
> Devel mailing list
> Devel at openvz.org
> https://lists.openvz.org/mailman/listinfo/devel



-- 
Sincerely yours, Pavel Odintsov



More information about the Devel mailing list