Now that you can download Abiquo and get a 30-day trial license, you may like to automate the deployment of a new datacenter in your Abiquo environment. I’ll explain here how to automatically deploy Abiquo using Cobbler.

First of all, you need to get Cobbler up and running. I’m not going to explain here how to install it, but you can use the official guide that is very detailed or these instructions for installing on CentOS 6. However, I will give you some advice about Cobbler installation. Review the output of the ‘cobbler check’ command to double check that everything is working fine. You will need to have at least DHCP and TFTP managed by Cobbler.

I will assume that you downloaded the Abiquo ISO into the tmp folder. First of all you need to mount the ISO:

[code lang=”bash”]mount -o loop /tmp/abiquo-linux-ee-2.4-GA.iso /media
[/code]

Then you need to import the ISO to Cobbler. Before you do that, you need to ensure the import command will recognize Abiquo. So you need to edit the /var/lib/cobbler/distro_signatures.json file and add the following “abiquo24” code in the Red Hat section. You should insert the code after the fedora section and before the debian section, as shown in the following example:

[code lang=”text”]},
“fedora18”: {
“signatures”:[“Packages”],
“version_file”:”(fedora)-release-18-(.*)\.noarch\.rpm”,
“version_file_regex”:null,
“kernel_arch”:”kernel-(.*)\.rpm”,
“kernel_arch_regex”:null,
“supported_arches”:[“i386″,”x86_64″,”ppc”,”ppc64″],
“supported_repo_breeds”:[“rsync”, “rhn”, “yum”],
“kernel_file”:”vmlinuz(.*)”,
“initrd_file”:”initrd(.*)\.img”,
“isolinux_ok”:false,
“default_kickstart”:”/var/lib/cobbler/kickstarts/sample_end.ks”,
“kernel_options”:”repo=$tree”,
“kernel_options_post”:””,
“boot_files”:[]},
“abiquo24”: {
“signatures”:[“FrameOS”],
“version_file”:”abiquo-release-ee-2.4.0-1.el5.noarch.rpm”,
“version_file_regex”:null,
“kernel_arch”:”kernel-(.*).rpm”,
“kernel_arch_regex”:null,
“supported_arches”:[“i386″,”x86_64″,”ppc”,”ppc64″],
“supported_repo_breeds”:[“rsync”, “rhn”, “yum”],
“kernel_file”:”vmlinuz(.*)”,
“initrd_file”:”initrd(.*)\.img”,
“isolinux_ok”:false,
“default_kickstart”:”/var/lib/cobbler/kickstarts/sample.ks”,
“kernel_options”:””,
“kernel_options_post”:””,
“boot_files”:[]}
},
“debian”: {
“squeeze”: {
“signatures”:[“dists”],
“version_file”:”Release”,
“version_file_regex”:”Codename: squeeze”,
“kernel_arch”:”linux-headers-(.*)\.deb”,
“kernel_arch_regex”:null,
“supported_arches”:[“i386″,”amd64”],
“supported_repo_breeds”:[“apt”],
“kernel_file”:”vmlinuz(.*)”,
“initrd_file”:”initrd(.*)\.gz”,
“isolinux_ok”:false,
“default_kickstart”:”/var/lib/cobbler/kickstarts/sample.seed”,
“kernel_options”:””,
“kernel_options_post”:””,
“boot_files”:[]}
},[/code]

Be careful with the commas ‘,’. They are important in a JSON file!

After you edit the file, restart Cobbler:

[code lang=”bash”]

service cobblerd restart

[/code]

Now we are ready to import Abiquo into Cobbler:

[code lang=”bash”]

cobbler import –path=/media –name=abiquo-2.4GA-x86_64

[/code]

Because Abiquo is based on CentOS but not just any CentOS, you need to do one last magic trick to overwrite the pxe files with the right ones. Cobbler will copy the default CentOS files, but we need the Abiquo ones.

[code lang=”bash”]

cp initrd.img vmlinuz /var/lib/tftpboot/images/abiquo-2.4GA-x86_64/

[/code]

To finish, you just need to define a kickstart file for the profile associated with the new distro. This is my example for a monolithic installation:

[code lang=”text”]<pre>install
text

url –url http://10.60.1.114/cobbler/ks_mirror/abiquo-2.4GA-x86_64/

lang en_US.UTF-8
keyboard us
#network –device eth0 –bootproto dhcp –hostname abiquo
rootpw temporal
firewall –disabled
authconfig –enableshadow –enablemd5
selinux –disabled
timezone –utc Europe/Madrid
bootloader –location=mbr

# unless you clear all partitions first, this is
# not guaranteed to work
zerombr yes
clearpart –all
part /boot –fstype ext3 –size=100 –asprimary
part pv.1 –size 1 –grow –asprimary
volgroup VolGroup00 pv.1
logvol swap –fstype swap –name=swap –vgname=VolGroup00 –recommended
logvol / –fstype ext4 –name=root –vgname=VolGroup00 –size=1 –grow

skipx
reboot

%packages
@core
@abiquo-monolithic

%post

mkdir /opt/vm_repository

service mysql start
mysql -e “grant all privileges on *.* to ‘root’@’%’ identified by ‘temporal’;”
mysql -e “flush privileges;”
mysql < /usr/share/doc/abiquo-server/database/kinton-schema.sql
service mysql restart
mysql -e “flush privileges;”
/usr/bin/abicli set database-password

echo “root soft nofile 4096” >> /etc/security/limits.conf
echo “root hard nofile 10240” >> /etc/security/limits.conf

chkconfig mysqld on
chkconfig redis on
chkconfig dhcpd on
chkconfig rabbitmq-server on
chkconfig iptables off
%end</pre>
[/code]

Or this kickstart to deploy a new datacenter:

[code lang=”text”]<pre>install
text

url –url http://10.60.1.114/cobbler/ks_mirror/abiquo-2.4GA-x86_64/

lang en_US.UTF-8
keyboard us
#network –device eth0 –bootproto dhcp –hostname abiquo
rootpw temporal
firewall –disabled
authconfig –enableshadow –enablemd5
selinux –disabled
timezone –utc Europe/Madrid
bootloader –location=mbr

# unless you clear all partitions first, this is
# not guaranteed to work
zerombr yes
clearpart –all
part /boot –fstype ext3 –size=100 –asprimary
part pv.1 –size 1 –grow –asprimary
volgroup VolGroup00 pv.1
logvol swap –fstype swap –name=swap –vgname=VolGroup00 –recommended
logvol / –fstype ext4 –name=root –vgname=VolGroup00 –size=1 –grow

skipx
reboot

%packages
@core
@abiquo-remote-services

%post

mkdir /opt/vm_repository

echo “root soft nofile 4096” >> /etc/security/limits.conf
echo “root hard nofile 10240” >> /etc/security/limits.conf

chkconfig redis on
chkconfig dhcpd on
chkconfig iptables off
%end</pre>
[/code]

O