You are viewing dougsland

Previous 10

Jun. 12th, 2014

Generating oVirt node iso with modified packages

About:
This post is about generate an oVirt Node image with updated packages, in
the below example we will update VDSM (node agent) and oVirt Node Plugin VDSM (TUI plugin for node registration).

Iso that will be updated: ovirt-node-iso-3.0.4-1.0.201401291204.vdsm34.el6.iso

Packages versions that will be updated in the above iso:
vdsm-4.14.6-0.el6.x86_64
ovirt-node-plugin-vdsm-0.1.1-10.el6.noarch

Note: CentOS 6.5 (CentOS-6.5-x86_64-minimal.iso) will be used in this demo as specific virtual machine to build oVirt Node iso.

Required tool to edit the node:
edit-node is the tool used to edit the node image and include a new package.
Please note that it must be run on the same OS which is used within the image.
So an CentOS image must be edited on a CentOS host.

Repos for edit-node:
1.el6: http://resources.ovirt.org/releases/node-base/edit-node-el6.repo
2.fedora: http://resources.ovirt.org/releases/node-base/edit-node.repo

Step by step:
# cat /etc/centos-release
CentOS release 6.5 (Final)

# yum install wget createrepo
# wget -O /etc/yum.repos.d/edit-node-el6.repo http://resources.ovirt.org/releases/node-base/edit-node-el6.repo

# yum install ovirt-node-tools (download stable edit-node and pre-requirements)

Install required packages for build:
# yum install make autoconf automake pyflakes logrotate gcc python-pep8 libvirt-python python-devel python-nose rpm-build sanlock-python genisoimage python-ordereddict python-pthreading libselinux-python python-ethtool m2crypto python-dmidecode python-netaddr python-inotify python-argparse git python-cpopen bridge-utils libguestfs-tools-c pyparted openssl libnl libtool gettext-devel

Update pep8:
# yum install http://danken.fedorapeople.org/python-pep8-1.4.5-2.el6.noarch.rpm

Install Apache to be your local repo
# yum install httpd
# chkconfig --levels 235 httpd on
# mkdir -p /var/www/html/nodebuild

Build vdsm and ovirt-node-plugin-vdsm:
# git clone git://gerrit.ovirt.org/vdsm && cd vdsm
# git checkout remotes/origin/ovirt-3.4 -b 3.4 (3.4 is current stable branch)
make your changes
# ./autogen.sh --system && make && make rpm && cd ..
* To ignore tests and other tips: http://www.ovirt.org/Vdsm_Developers#Building_a_Vdsm_RPM

# git clone git://gerrit.ovirt.org/ovirt-node-plugin-vdsm && cd ovirt-node-plugin-vdsm
# git checkout remotes/origin/node-3.0 -b 3.0 (3.0 is the current stable branch)
make your changes
# ./autogen.sh && make && make rpms && cd ..

Copy rpms generated to /var/www/html/nodebuild/ and create a local repo
# cp ~/rpmbuild/RPMS/noarch/* ~/rpmbuild/RPMS/x86_64/* /var/www/html/nodebuild/
# createrepo /var/www/html/nodebuild/

Add the additional repo:
# vi /etc/yum.repos.d/edit-node-el6.repo
[nodebuild]
name=Local node build
baseurl=http://127.0.0.1/nodebuild/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY
gpgcheck=0
enabled=1

Download the iso that will be changed:
# wget http://resources.ovirt.org/releases/3.4/iso/ovirt-node-iso-3.0.4-1.0.201401291204.vdsm34.el6.iso

Download the last edit-node and execute it:
# git clone git://gerrit.ovirt.org/ovirt-node
# ovirt-node/tools/edit-node --repo /etc/yum.repos.d/edit-node-el6.repo --update vdsm,ovirt-node-plugin-vdsm* ovirt-node-iso-3.0.4-1.0.201401291204.vdsm34.el6.iso --name mynewovirtbuild

Note: It's not required to store edit-node repo into /etc/yum.repos.d. You can use it in any directory to avoid cluttering up normal system operation.

Others related links:
http://www.ovirt.org/Node_Building
http://www.ovirt.org/Node_Building#Adding_a_plugin_to_a_build

Jun. 8th, 2014

Setting up a TFTP server, PXE boot server with libvirt and virt-manager for ovirt-node

About
This post is about setup virt-manager to autoinstall oVirt Node as virtual machine via libvirt/PXE. Additionaly, TFTP server will be installed in the host machine which runs the virt-manager.

System
I have created the post based on Fedora 20, fell free to post comments about your experience in others versions or distros.

Installing and Setting packages
# yum install virt-manager tftp tftp-server libvirt livecd-tools -y

Reload libvirtd to create virbr0
# /bin/systemctl restart libvirtd.service

Notice that now you will have the virbr0 interface:
# ip addr
3: virbr0: NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
link/ether 56:14:04:78:c4:f7 brd ff:ff:ff:ff:ff:ff
inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
valid_lft forever preferred_lft forever

1) Configure the XML of the default libvirt network to include the PXE settings:
bootp file='pxelinux.0' server='192.168.122.1'

# virsh net-destroy default
# virsh net-edit default
# virsh net-start default



2) Enable tftp-server
# vi /etc/xinet.d/tftp
Replace:
disable = yes
To:
disable = no

# /bin/systemctl restart xinetd.service

3) Download ovirt-node image and setup tftpboot
Download the last oVirt Node stable available:
# wget http://resources.ovirt.org/releases/3.4.0-ga/iso/ovirt-node-iso-3.0.4-1.0.201401291204.vdsm34.el6.iso

Convert livecd to pxeboot image:
# livecd-iso-to-pxeboot ./ovirt-node-iso-3.0.4-1.0.201401291204.vdsm34.el6.iso

Copy the files generated to tftp directory:
# cp -Rpv tftpboot/* /var/lib/tftpboot/

Edit default file and include ovirt node settings
# vi /var/lib/tftpboot/pxelinux.cfg/default

Example:
DEFAULT pxeboot
TIMEOUT 20
PROMPT 0
LABEL pxeboot
    KERNEL vmlinuz0
    APPEND rootflags=loop initrd=initrd0.img root=live:/ovirt-node-iso-3.0.4-1.0.201401291204.vdsm34.el6.iso rootfstype=auto ro liveimg check RD_NO_LVM rd_NO_MULTIPATH rootflags=ro crashkernel=128M elevator=deadline install quiet max_loop=256 rhgb rd_NO_LUKS rd_NO_MD rd_NO_DM firstboot storage_init=/dev/vda ssh_pwauth=1 adminpw=ovonFQQPIAM9o management_server=192.168.100.228 BOOTIF=link
IPAPPEND 2


Where:
- firstboot: first boot
- adminpw: Sets an encrypted, temporary password for admin (ovonFQQPIAM9o is ovirt encrypted)
- management_server: Specifies - the management server to be used.
- storage_init: Initialize a local storage device. (Depending can be vda/sda)
- ssh_pwauth: Enable ssh
- BOOTIF: specify network for bridge (link = autodetect)

Setting Firewalld
firewall-cmd --permanent --add-service=tftp
firewall-cmd --reload

Virt-manager
First, check if your host has enabled the nested-kvm, if not, enable it and via virt-manager interface copy the Processor flags to the virtual-machine. After that, create your new virtual machine for oVirt Node based on PXE boot.



Links related to this topic
http://www.ovirt.org/Node_PXE
http://www.ovirt.org/Node_Autoinstall
http://dougsland.livejournal.com/122359.html
http://dummdida.blogspot.com.br/2012/06/doing-pxe-with-libvirt-virt-manager.html
https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Virtualization_Host_Configuration_and_Guest_Installation_Guide/chap-Virtualization_Host_Configuration_and_Guest_Installation_Guide-Libvirt_network_booting.html#idp18883360

May. 12th, 2014

FISL15 - oVirt report

Last week I participated of FISL conference from 7th to 10th May in Porto
Alegre/Brazil with Red Hat team and Fedora community to promote oVirt
and cloud technologies, below my view of these days.

For those who never heard about FISL, it is the largest FOSS events in
LATAM and one of the largest in the world, this year they had 6.017
participants according with official report. The registered audience
includes community, developers, companies,
students, colleges and government institutions.

oVirt Community update

This year we had a special guest Brian Proffitt, the Technical
Community Manager of oVirt. He joined our troop which contained
Amador Pahim (Red Hat), Marcelo Barbosa (Community member) and myself
(Red Hat) to demostrate and talk about oVirt.

Below the talks during our community update:

- oVirt Overview - Amador Pahim



- The Road Ahead for the oVirt Community - Brian Proffitt



- Installation Process - Marcelo Barbosa



- Hot Features in current version - Amador Pahim



- v2v Migrating virtual machines to oVirt - Douglas Landgraf




The feedback was very positive, people often raised hands to make
questions during all presentations. As expected, we knew some
faces in the crowd from previous years of community update and
we are glad to have such people year after year sharing
their thoughts and needs.

Some highlights that I would like to point are:

- New users from VMWare want to migrate to oVirt. Year after year we
always have people asking how to migrate from VMWare environment to oVirt.
Two special cases this time, one from Brazilian government and other from private
company which are looking for a open source solution to a
possible migration of 400 VMware guests.

- Questions about ipv6 support

- A developer from community want to make oVirt run in Slackware and
will join forces to us.

- A teacher from Brazillian Computer Science college shared that he
has a student doing his Conclusion work about oVirt and asked if
we are interested about it. I replied instantly that we are and can
help him with any information that he needs.

- User reporting that he has oVirt and RHEV running in their
environment. RHEV as main platform to their customers and oVirt
for the development phase of their product.

To close the oVirt participation in the event with the gold key we had
Brian Proffitt in: oVirt: How to Connect with a Really Mature Open Source Project.



A brillant talk showing the history of oVirt and RHEV from the early days as commercial and closed
solution to acquisition of Qumranet by Red hat. For me it was very cool to remember these
early days which I was part of it.

All slides will be available here: http://www.ovirt.org/OVirt_Slide_Decks

Thanks again to all oVirt troop guys which spend 3 full days sharing
the knowledge to oVirt users and to Leonardo Vaz to make the booth happen.
See you there next year!

Jul. 9th, 2013

FISL14 - oVirt and Cloud EcoSystem



Last week I participated of FISL conference from 3th to 6th July in Porto
Alegre/Brazil with Red Hat team and Fedora community to promote oVirt
and cloud technologies, below my view of these days.

For those who never heard about FISL, it is the largest FOSS events in LATAM and one of the largest in the world, having around 8.000
participants. The registered audience includes community, developers, companies,
students, universities and government institutions.

oVirt activities during FISL

This year we had a lot of people interested about oVirt (yes, the
project is growing pretty fast here in LATAM) visiting our booth and
we learning about the project, the features and hearing what they can
expect in the upcoming releases.

We also had talks about oVirt and Virtualization ecosystem in
conference program:

oVirt Community update


Speakers: Amador Pahim (left), Marcelo Barbosa (Fedora Ambassador and local oVirt community), Douglas Landgraf (right)

At the beggining we had only Red Hatters involved in this talk, but we
invited Marcelo since he is a oVirt/Fedora passionated contributor
which has been promoting and testing it in his free time.

The audience was a mixed between people that want to learn about oVirt
and people that already uses oVirt, some of attending includes
computer science students, HP Brazil, Brazilian govern institute,
Brazilian Colleges and so on.

We started the talk introducing oVirt, telling what is it about,
explaining the architecture, features, supported components (storage,
domain controllers, etc.) etc. We also described supported
installation process and we used the remaining time for a demo and to
answer audience questions.

In the end, people started asking how to migrate from a Vmware/Vshere
scenario (Yes, we do. See v2v tool). Mental note for upcoming events:
Work in a talk to explain this tools in depth.

Ovirt + Gluster
Speaker: Theron Conrey (Red Hat)



One of the greatest talks in our opinion, because Theron provived an
excellent overview of Cloud Computing and explained how to build one
using oVirt/Gluster.

Spacewalk & oVirt

Speakers: Marcelo Mello and Amador Pahim (from Red Hat)

Another great talk, where Marcelo and Amador made Spacewalk/oVirt work
together in a demo for provisioning a environment capable to scale
based on the demand.



KVM - Ademar Reis

Ademar provided an excellent report about KVM/libvirt/qemu recent
enhancements and what the can be expected in Virtualization field for
upcoming years.


Additionally, Theron (left), Ademar (center) and John Mark Walker talked about virtualization in a booth.

oVirt Features 3.1 -> 3.2


Speakers: Douglas, Amador Pahim (from Red Hat), Marcelo Barbosa
(Fedora Ambassador and local oVirt community)

We used this talk to present a list of features from oVirt to 3.1 to
3.2, including some demos.

Openshift



Fabiano Franz talked about OpenShift in the main track/booth a lot of people interested about openshift. Diane Mueller provided a demo in our booth.

Besides the talks above, we also presented small quick version of the
talks at the booth for those ones which were interested on attending
it. There were also many other talks about virtualization projects
sponsored by Red Hat in main conference program, presented by other
people and companies.

I'd like to thank all people involved on it (too many names to list here) but specially Leonardo Menezes Vaz and Leslie Hawthorn which worked hard to have our space/booth and all stuff ready for this event.

See you there next year!

Mar. 14th, 2012

liveusb-creator: Create bootable USB with any ISO

Burn any bootable ISO to USB:
https://fedorahosted.org/liveusb-creator/

or

(Fedora)
$ yum install liveusb-creator

Really useful tool! :)

Oct. 9th, 2011

Howto: Setting PXE server to install RHEV-H

There is nothing in special to setup the PXE server for RHEV. However, if you are wondering how to create one, please follow the steps below.

First, let's identify which subnet we are going to use. In my case, the subnet will be 192.168.1.X.

Checking the subnet


# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:1E:C9:20:3F:6B
inet addr:192.168.1.101 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::21e:c9ff:fe20:3f6b/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4453951 errors:0 dropped:0 overruns:0 frame:0
TX packets:3350991 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3216624601 (2.9 GiB) TX bytes:1188936874 (1.1 GiB)
Interrupt:21 Memory:febe0000-fec00000

Installing DHCP



dhcp - is required because the client machine will boot from PXE and adquire an IP address from the DHCP server available at the subnet.

1) # yum install dhcp -y

Setting DHCP


2) vi /etc/dhcp/dhcpd.conf

authoritative;
ddns-update-style none;

subnet 192.168.1.0 netmask 255.255.255.0 {
range dynamic-bootp 192.168.1.190 192.168.1.200;
range 192.168.1.201 192.168.1.250;
option domain-name-servers 192.168.1.101; # DHCP Server
#option domain-name "medogz.com";
option routers 192.168.1.101; # DHCP Server
option broadcast-address 192.168.1.255;
default-lease-time 600;
max-lease-time 7200;
}

# HOST - RHEV
host rhev-server1 {
hardware ethernet 00:15:C5:E0:D3:27; # MAC from machine that will boot via PXE
fixed-address 192.168.1.240; # Fixed IP address
filename "pxelinux.0"; # File that will be downloaded by the client
next-server 192.168.1.101; # DHCP Server
}

# vi /etc/sysconfig/dhcpd
# Command line options here
DHCPDARGS=eth0

# chkconfig dhcpd on

# service dhcpd start
Starting dhcpd: [ OK ]

Installing TFTP



tftp - will be used to transfer the image to be installed into the clients from the server.

# yum install tftp tftp-server -y

# chkconfig xinetd on
# chkconfig tftp on

# service xinetd start
Starting xinetd: [ OK ]

Preparing pxeboot



Extract files available inside the rpm or install it.
Below RPM available only via Red Hat Channel.

# rpm2cpio rhev-hypervisor-6.2-0.17.2.el6.noarch.rpm | cpio -div
./usr/bin/rhevh-iso-to-disk
./usr/bin/rhevh-iso-to-pxeboot
./usr/share/rhev-hypervisor/rhev-hypervisor.iso
./usr/share/rhev-hypervisor/version.txt
241719 blocks

Converting the iso image to a PXE boot

note: you can use livecd-iso-to-pxeboot tool as well.
# bin/rhevh-iso-to-pxeboot share/rhev-hypervisor/rhev-hypervisor.iso
Your pxeboot image is complete.

Copy tftpboot/ subdirectory to /tftpboot or a subdirectory of /tftpboot.
Set up your DHCP, TFTP and PXE server to serve /tftpboot/.../pxeboot.0

Note: The initrd image contains the whole CD ISO and is consequently
very large. You will notice when pxebooting that initrd can take a
long time to download. This is normal behaviour.

Copying the generated files

The directory tftpboot/ was generated with the files to create the PXE boot.

Before copying, let's find which directory tftpboot service is setup.

# cat /etc/xinetd.d/tftp | grep -v ^#
service tftp
{
disable = no
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /var/lib/tftpboot
per_source = 11
cps = 100 2
flags = IPv4
}

In this case, the directory is /var/lib/tftpboot as showed in the server_args parameter.

# cp -Rpv tftpboot/* /var/lib/tftpboot/
`tftpboot/initrd0.img' -> `/var/lib/tftpboot/initrd0.img'
`tftpboot/pxelinux.0' -> `/var/lib/tftpboot/pxelinux.0'
`tftpboot/pxelinux.cfg' -> `/var/lib/tftpboot/pxelinux.cfg'
`tftpboot/pxelinux.cfg/default' -> `/var/lib/tftpboot/pxelinux.cfg/default'
`tftpboot/vmlinuz0' -> `/var/lib/tftpboot/vmlinuz0'

Now it's time to setup the pxelinux.cfg/, this directory holds the files that the pxeboot will look during the boot. Each file be named as the fixed IP address of client converted to hexadecimal, for example (192.168.1.240):

# cd /var/lib/tftpboot/pxelinux.cfg

# gethostip -x 192.168.1.240
C0A801F0

Copying the default settings of RHEV PXE boot
# cp default C0A801F0

Preparing Firewall


Allow the MAC from the client machine.

# iptables -I INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
# iptables -I INPUT 1 -m mac --mac-source 00:15:C5:E0:D3:27 -j ACCEPT
# service iptables save

Ok, everything done, it's time to boot your client machine via PXE (please note that this can take some time)

References about PXE and kickstart


Instalação Automatizada de Servidores com Kickstarts – Parte II – Integrando com Servidores PXE
http://marcelo.mmello.org/2010/04/instalacao-automatizada-de-servidores-com-kickstarts-parte-ii-integrando-com-servidores-pxe/

Sep. 27th, 2011

restapi: urllib2 + auth + put + xml

https://github.com/dougsland/rhev3-restapi-scripts/blob/master/sample-put.py

restapi: urllib2 + auth + delete + xml

https://github.com/dougsland/rhev3-restapi-scripts/blob/master/sample-delete.py

restapi: urllib2 + auth + post + xml

https://github.com/dougsland/rhev3-restapi-scripts/blob/master/createDataCenter.py

Sep. 25th, 2011

yum: prevent a package to be updated in your system

1) Enable the yum-plugin-versionlock

Example:
$ vi /etc/yum/pluginconf.d/versionlock.conf
[main]
enabled = 1
locklist = /etc/yum/pluginconf.d/versionlock.list
# Uncomment this to lock out "upgrade via. obsoletes" etc. (slower)
# follow_obsoletes = 1


2) Add the list of packages to be protected:
/etc/yum/pluginconf.d/versionlock.list

Example:
jack-audio-connect-kit-1.9.4
qjackctl-0.3.6


Additional info:
http://docs.fedoraproject.org/en-US/Fedora/14/html/Software_Management_Guide/ch06s25.html
http://docs.fedoraproject.org/en-US/Fedora/15/html/Musicians_Guide/sect-Musicians_Guide-CCRMA_Preventing_Package_Updates.html

Previous 10

June 2014

S M T W T F S
1234567
891011121314
15161718192021
22232425262728
2930     

Tags

Syndicate

RSS Atom
Powered by LiveJournal.com