0. Preamble.
The article is a small guide on the capabilities of Clonezilla SE using a specific example.
The task was to install the system on 10 servers in the remote ds.
You need to install the system on bare metal.
I looked in the direction of the partimage server - conveniently, but not quite (copying only partitions, you need to boot, for example, from the System Rescue CD).
')
In the end - stopped at Clonezilla.
The distribution kit happens two versions:
1. Clonezilla (
http://clonezilla.org/downloads.php )
2. Clonezilla Server Edition (
http://drbl.org/download/ )
The second option leads to another site - drbl (and another livecd). And this is true because Clonezilla Server Edition is Clonezilla (utility) + drbl (diskless remote boot in linux).
In principle, you can take the Clonezilla LiveCD and put it on top of the drbl (similar to the example in this article: http://www.howtoforge.com/cloning-linux-systems-with-clonezilla-server-edition-clonezilla-se ). However, on this way (by experience) we are waiting for a certain amount of rake and lost time. Our task implies that the solution needs to be set up quickly. Therefore, we will take the LiveCD Drbl in which Clonezilla is enabled by default.
1. Working with the Drbl LiveCD
It can (in conjunction with drbl):
- - copy the entire disk to the image, except for the image, all technical information about the computer being cloned + mbr.
- -work with ext4 (partimage ext4 recognizes as ext3, which in principle is not terrible, but still)
- -divide the image immediately to a certain number of machines (start cloning either by timeout or by the number of machines)
- -work with LiveCD with loading the whole image into RAM
- -dividing through NAT the Internet on machines booted by PXE via the cloning server (if there is an Internet connection)
- - allows you to download a system similar to the LiveCD on the LiveCD (and since from the previous paragraph - it can also NAT, it will be possible to put a couple of packets, for example). This helps if KVM with the ability to hook images is only on one machine in ds, and on the rest - only regular KVM, without such a possibility.
- -migrate grub after image fill
- - automatically increase the partition “proportionally” if the disk on which the image is restored is larger than the image itself (while the swap partition also increases proportionally). If you don’t want to be proportional - you can always choose a point with a separate partitioning of the disk on the client (do not forget that the partition numbers should correspond to the partition numbers on the standard).
- - execute script on completion of cloning
Can not:
- -EFI (so it's better to put grub on the cloned image right away)
To clone a system over a network over a network, we need two objects:
- Image of the reference system
- Server with a bundle of Clonezilla + drbl
Since in our case there is no free server, we will use the following scheme:
1. Install the reference system on one of the servers.
Install the packages, configure the network (dhcp, static). If the network is static, you can use a script similar to the following (we will write it in the rc.local of the reference server):
root@1:~# cat ~/ip_check.sh
# / bin / bash
hostname = host-name
network = 192.168.0
domain = domain
if [-f / etc / network / pid];
then exit 0;
else echo 1> / etc / network / pid;
for i in $ (seq 3 12);
do `fping -u -c1 $ network. $ i`;
if [$? -eq "1"]; then
/ bin / sed -i.bak -es / address \ $ network.2 / address \ $ network. $ i / g / etc / network / interfaces;
h = `expr $ i - 1`;
echo "$ hostname $ h"> / etc / hostname;
echo "$ network. $ i $ hostname $ h. $ domain $ hostname $ h" >> / etc / hosts;
shutdown -r now;
exit 0;
fi;
done;
fi;
root @ 1: ~ # cat /etc/rc.local
/root/ip_check.sh
2. Run the LiveCD on this server benchmark.
Select a full disk load in RAM, in the boot loader from the disk: “Other modes of DRBL Live” -> “DRBL Live (To Ram. Boot media can be removed later)”.
3. Perform cloning.
Using the “Clonezilla live” icon of an existing hard disk to an image (device-image point) to a local disk (actually RAM, to the mounted / home / partimag directory) of this LiveCD (skip point).
4. Run drbl.
Launch the drbl server with the Clonezilla server icon. Choose the type of multicast replication and the number of clients after which it should start. As an action on completion - choose halt - the servers must be turned on alternately.
5. We are overloading the servers.
In my example, the servers are loaded by default from the network, so we are overloading the servers to which we want to clone the system.
* UPD * Corrected script.