Change VEID without recalculating quota :: vzmlocal openvz option [message #20688] |
Tue, 25 September 2007 07:55 |
rickb
Messages: 368 Registered: October 2006
|
Senior Member |
|
|
Hello friends, I posted about this a few months ago but I can't find it; devs confirmed there was no solution right now but I think I am onto one.
problem:
I want to change the VEID without recalculating the quota. Naturally I change /vz/private/OLD to /vz/private/NEW, OLD.conf to NEW.conf, then start NEW. Vzctl then wants to calc the fresh quota as it should. I have tried to move /var/vzquota/OLD.quota to NEW.quota but the value OLD is stored in the binary quota file and thus is a corrupt NEW quota file.
solution:
I then remembered that the virtuozzo tool vzmlocal can rename a VE and does not require quota [re]calculation upon start. vzmlocal is a binary tool, does anyone know if it performs some replacement on the OLD.quota binary? If so, I am interested in doing this myself.
Any pointers or ideas on how to rename a VE without quota calc on openvz are appreciated.
Thanks!
Rick
-------------
Common Terms I post with: http://wiki.openvz.org/Category:Definitions
UBC. Learn it, love it, live it: http://wiki.openvz.org/Proc/user_beancounters
[Updated on: Tue, 25 September 2007 08:03] Report message to a moderator
|
|
|
|
|
Re: Change VEID without recalculating quota :: vzmlocal openvz option [message #20796 is a reply to message #20795] |
Wed, 26 September 2007 10:29 |
rickb
Messages: 368 Registered: October 2006
|
Senior Member |
|
|
Yes this is definitely the key, see below:
[root@germanium ~]# md5sum /var/vzquota/quota.9889792
78f3b64633a22139dcd3834beb2bb2ef /var/vzquota/quota.9889792
[root@germanium ~]# vzmlocal 9889792:12345
Moving/copying VE#9889792 -> VE#12345, [], [] ...
Moving private area '/vz/private/9889792'->'/vz/private/12345'
done
Copying/modifying config scripts of VE#9889792 ...
done
Successfully completed
[root@germanium ~]# md5sum /var/vzquota/quota.12345
16288b19128a28c734370d3c50b36a4d /var/vzquota/quota.12345
[root@germanium ~]# strings /var/vzquota/quota.12345 | grep 12345
/vz/private/12345
[root@germanium ~]#
strace output:
write(1, "Copying/modifying config scripts"..., 49) = 49
stat64("/var/vzquota/quota.9889792", {st_mode=S_IFREG|0644, st_size=1365, ...}) = 0
open("/var/vzquota/quota.9889792", O_RDONLY) = 4
open("/var/vzquota/quota.12345", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 5
fstat64(4, {st_mode=S_IFREG|0644, st_size=1365, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4010c000
read(4, "\'\274\334\376\4\0\0\0\0\0\0\300\1\0\0\0\0\0\0\200\1\0"..., 8192) = 1365
read(4, "", 4096) = 0
read(4, "", 8192) = 0
fstat64(5, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4010d000
write(5, "\'\274\334\376\4\0\0\0\0\0\0\300\1\0\0\0\0\0\0\200\1\0"..., 1365) = 1365
close(5) = 0
munmap(0x4010d000, 4096) = 0
close(4) = 0
vzmlocal is a magical tool! Do you know how we can safely modify this binary file without vzmlocal?
Rick
-------------
Common Terms I post with: http://wiki.openvz.org/Category:Definitions
UBC. Learn it, love it, live it: http://wiki.openvz.org/Proc/user_beancounters
[Updated on: Wed, 26 September 2007 10:57] Report message to a moderator
|
|
|