On 07/21/2016 01:40 PM, Giorgio Biacchi wrote:
> Hi list,
> starting from here
> (http://lists.ovirt.org/pipermail/devel/2016-January/012073.html) and 
> adjusting
> broken links now I'm able to pxe boot CentOS 7 + kernel arguments:
> LABEL node_4
>  MENU LABEL Ovirt Node 4.0
>  KERNEL centos7/x86_64/vmlinuz
>  APPEND initrd=centos7/x86_64/initrd.img ramdisk_size=100000 ksdevice=link
> inst.ks=
> inst.updates=http://jenkins.ovirt.org/job/ovirt-node-ng_master_build-artifacts-fc22-x86_64/lastSuccessfulBuild/artifact/exported-artifacts/product.img
> inst.stage2=http://mi.mirror.garr.it/mirrors/CentOS/7/os/x86_64/
> I think this method is the best for me because with a custom kickstart I can 
> set
> ssh keys and custom hooks and have a fully automated installation, but I'm not
> sure if the lastSuccessfulBuild/artifact/exported-artifacts/product.img is the
> correct image to pass to have a "stable" node.
> There's any other "stable" product.img I can use?
> Thanks

Hello again,
just found out that the simplest method to obtain a stable product.img and
ovirt-node-ng-image.squashfs.img is to loop mount an ovirt node iso, get the
files from there and make them available via http.

Now with a modified PXE and kickstart file I'm able to automate the installation

Here's my PXE conf and kickstart file, maybe they will be useful for someone...

--- <PXE> ---

LABEL node_4
MENU LABEL Ovirt Node 4.0.2 (testing)
KERNEL centos7/x86_64/vmlinuz
APPEND initrd=centos7/x86_64/initrd.img ramdisk_size=100000 ksdevice=link

--- </PXE> ---

--- <Kickstart> ---
# CentOS 7.2 compatible kickstart for CI auto-installation

lang en_US.UTF-8
keyboard us
timezone --utc Etc/UTC --ntpservers=tempo.ien.it
auth --enableshadow --passalgo=sha512
selinux --permissive
network --bootproto=dhcp --onboot=on
firstboot --reconfig

#Set root password
rootpw --iscrypted <place crypted password here>

# or use plain text
#rootpw --plaintext ovirt


clearpart --all --initlabel --disklabel=gpt
bootloader --timeout=1

# FIXME This should be fixed more elegantly with
# At best we could use: autopart --type=thinp
# autopart can not be used in CI currently, because updates.img is not passed to
# the installation

# Manual layout:
reqpart --add-boot
part pv.01 --size=42000 --grow
volgroup HostVG pv.01
logvol swap --vgname=HostVG --name=swap --fstype=swap --recommended
logvol none --vgname=HostVG --name=HostPool --thinpool --size=40000 --grow
logvol / --vgname=HostVG --name=root --thin --poolname=HostPool
--fsoptions="defaults,discard" --size=6000
logvol /var --vgname=HostVG --name=var --thin --poolname=HostPool
--fsoptions="defaults,discard" --size=15000

# The trick is to loop in the squashfs image as a device
# from the host
liveimg --url="";

# Assumption: A virtio device with the serial livesrc is passed, pointing
# to the squashfs on the host.
mkdir -p /mnt/livesrc
mount /dev/disk/by-id/virtio-livesrc /mnt/livesrc

export PATH

#Setup public ssh keys, at least ovirt-engine one..

cd /root
mkdir --mode=700 .ssh

cat >> .ssh/authorized_keys << "PUBLIC_KEY"

chmod 600 .ssh/authorized_keys
chmod 700 .ssh
chcon -t ssh_home_t .ssh/
chcon -t ssh_home_t .ssh/authorized_keys

#My custom VDSM hooks

mkdir -p /usr/libexec/vdsm/hooks/before_vdsm_start
cd /usr/libexec/vdsm/hooks/before_vdsm_start

cat >> 10_set_ib0_connected_mode << "EOF"

echo Setting IB connected mode
echo connected > /sys/class/net/ib0/mode
sleep 3
MODE=$(cat /sys/class/net/ib0/mode)
RATE=$(cat /sys/class/infiniband/mlx4_0/ports/1/rate)
echo ib0 is now in $MODE mode with rate $RATE

chmod +x /usr/libexec/vdsm/hooks/before_vdsm_start/10_set_ib0_connected_mode

mkdir -p /usr/libexec/vdsm/hooks/after_network_setup
cd /usr/libexec/vdsm/hooks/after_network_setup

cat >> 10_set_ib0_connected_mode << "EOF"

echo connected > /sys/class/net/ib0/mode
sleep 3
ip link set mtu 65520 dev ib0

chmod +x /usr/libexec/vdsm/hooks/after_network_setup/10_set_ib0_connected_mode

# FIXME maybe the folowing lines can be collapsed
# in future into i.e. "nodectl init"
set -x
imgbase --debug layout --init

--- </Kickstart> ---

As last thing.. installing a node from the iso give me a corrupted imagebase
because discard option is missing from fstab.


PGP Key: http://pgp.mit.edu/
Primary key fingerprint: C510 0765 943E EBED A4F2 69D3 16CC DC90 B9CB 0F34
Users mailing list

Reply via email to