[one-users] VM clone speed improvement for shared storage clouds
Jhon Masschelein
jhon.masschelein at sara.nl
Wed Apr 18 00:38:30 PDT 2012
Hi,
In case this has not been mentioned on the list.
FYI: Below I'm talking about non persistent images since persistent
images do not get cloned but symlinked.
If you have a shared storage cloud, the tm_clone script can easily be
improved. before the fix on our cloud, it took about 12 minutes to
launch ten virtual machines with 50GB Images.
After the change, it takes 4 minutes which is quite a nice improvement.
(It now takes about 10 minutes to launch 5TB worth of VM images. :) )
The standard script /usr/lib/one/tm_commands/shared/tm_clone.sh will
execute the following:
(line 61):
ssh_exec_and_log $DST_HOST \
"cd $DST_DIR; cp -r $SRC_PATH $DST_PATH" \
"Error copying $SRC to $DST"
(We're running 3,2,1 and the "cd $DST_DIR;" is new in 3.4. Not sure what
it is supposed to do but it should not make a difference.)
The problem with the existing script is that the "cp -r $SRC_PATH
$DST_PATH" part is actually reading the whole image from the fileserver
to the opennebula server and then writes it back to a different
directory on the same fileserver.
The result is a very busy opennebula server which becomes unresponsive
and a under-used (NFS) fileserver.
When you make sure that the oneadmin user can ssh to the fileserver, and
that on the fileserver you put a symbolic link that points /var/lib/one
to the exported oneadmin home dir, you can simply change the cp line to
"ssh $<your_fileserver_here> cp -r $SRC_PATH $DST_PATH"
This will make oneadmin ssh to the fileserver and do the copy locally on
the fileserver.
This puts the load on the fileserver (where it belongs) and makes the
operation very light on the opennebula server which stays responsive.
Since most shared storage boxes like ours are geared towards fast IO,
this gives a very nice deployment speed increase.
Because the fileserver hostname or ip address needs to be put in the
script, it is difficult to make a patch; this info would need to be
added to a config file somewhere. I leave that up to a volunteer. :)
Hoping this is useful to somebody,
Jhon
--
Jhon Masschelein
Senior Systeemprogrammeur
SARA - HPCV
Science Park 140
1098 XG Amsterdam
T +31 (0)20 592 8099
F +31 (0)20 668 3167
M +31 (0)6 4748 9328
E jhon.masschelein at sara.nl
http://www.sara.nl
More information about the Users
mailing list