?

Log in

Previous 10 | Next 10

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

Sep. 24th, 2011

libvirt/virt-manager: snapshot corrupted, how can I start my virtual machine again?

virsh # start my-virtual-machine-name
error: Failed to start domain my-virtual-machine-name
error: cannot send monitor command '{"execute":"qmp_capabilities"}': Connection reset by peer


1) Remove any snapshot available
# rm -f /var/lib/libvirt/qemu/save/my-virtual-machine-name

2) restart libvirtd
# service libvirtd restart

3) Start the virtual machine again

Sep. 9th, 2011

RHEV 3.0: REST API example (python)

Below, just an example how powerful and simple REST API is in RHEV 3.0

https://github.com/dougsland/ovirt-restapi-scripts/blob/master/summary.py

$ python summary.py -i 192.168.123.176 -u rhevm@ad.rhev3.com -p T0pSecreT!
Connecting to: https://192.168.123.176:8443/api
hosts: total 1
hosts: active 0
users: total 1
users: active 1
vms: total 0
vms: active 0
storage_domains: total 0
storage_domains: active 0

All examples: 
https://github.com/dougsland/ovirt-restapi-scripts
Tags:

Aug. 22nd, 2011

Fedora/CentOS/RHEL: setting bond

Below an example of setting bond (active-backup mode)

1) Disable NetworkManager (if you have)
# chkconfig NetworkManager off
/etc/init.d/NetworkManager stop

2) Load module
# vi /etc/modprobe.d/bonding.conf
alias bond0 bonding

3) Setup eth0
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
MASTER=bond0
SLAVE=yes
USERCTL=no
ONBOOT=yes
BOOTPROTO=none

4) Setup eth1
# vi /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE="eth1"
ONBOOT=yes
USERCTL=no
MASTER=bond0
SLAVE=yes

5) Setup bond0
# vi /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
BOOTPROTO=none
ONBOOT=yes
IPADDR=192.168.1.54
NETWORK=192.168.1.0
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
DNS=8.8.8.8
USERCTL=no
BONDING_OPTS="miimon=1000 mode=active-backup"
TYPE=Ethernet

6) Restart your network service or reboot your machine

7) Checking bonding setup
# cat   /proc/net/bonding/bond0

More about bonding:
/usr/src//Documentation/networking/bonding.txt

Aug. 11th, 2011

Fedora: Glade 3.6.7 - Stock button not showing the image

# yum install gconf-editor
# gconf-editor

1. Go to desktop -> gnome ->interface
2. Check "buttons_have_icons"
Tags:

Previous 10 | Next 10

October 2016

S M T W T F S
      1
2345678
9101112131415
16171819202122
23242526272829
3031     

Tags

Syndicate

RSS Atom
Powered by LiveJournal.com