8.3. Preparing Hypervisor Installation Media

8.3.1. Preparing USB Hypervisor Installation Media

8.3.1.1. Preparing a Hypervisor USB Storage Device

Red Hat Enterprise Virtualization Hypervisor is able to install itself onto USB storage devices or solid state disks. However, the initial boot/install USB device must be a separate device from the installation target. Network booting with PXE and tftp provides the greatest flexibility and scalability. For environments where network restrictions prevent network booting, or for systems without PXE capable network interface cards, a local media installation such as CD-ROM or USB is necessary. Booting from USB storage devices is a useful alternative to booting from CD, for systems without CD-ROM drives.

Note

Not all systems support booting from a USB storage device. Ensure that your system's BIOS supports booting from USB storage devices before proceeding.

8.3.1.2. Preparing USB Installation Media Using livecd-iso-to-disk

Summary
The livecd-iso-to-disk utility included in the livecd-tools package can be used to write a Hypervisor or other disk image to a USB storage device. Once a Hypervisor disk image has been written to a USB storage device with this utility, systems that support booting via USB can boot the Hypervisor using the USB storage device.
The basic syntax for the livecd-iso-to-disk utility is as follows:
# livecd-iso-to-disk [image] [device]
The [device] parameter is the path to the USB storage device on which to write the disk image. The [image] parameter is the path and file name of the disk image. The default Hypervisor image location is /usr/share/rhev-hypervisor/rhev-hypervisor.iso. The livecd-iso-to-disk utility requires devices to be formatted with the FAT or EXT3 file system.

Note

The livecd-iso-to-disk utility uses a FAT or EXT3 formatted partition or block device.

Note

USB storage devices are sometimes formatted without a partition table. In this case, use a generic identifier for the storage device such as /dev/sdb. When a USB storage device is formatted with a partition table, use the path name to the device, such as /dev/sdb1.

Procedure 8.2. Preparing USB Installation Media Using livecd-iso-to-disk

  1. Install the rhev-hypervisor package to download the latest version of the Hypervisor.
  2. Use the livecd-iso-to-disk utility to copy the disk image, located in the /usr/share/rhev-hypervisor/ directory, to the USB storage device. The --format parameter formats the USB device. The --reset-mbr parameter initializes the Master Boot Record (MBR).

    Example 8.1. Use of livecd-iso-to-disk

    This example demonstrates the use of livecd-iso-to-disk to write to a USB storage device named /dev/sdc and make the USB storage device bootable.
    # livecd-iso-to-disk --format --reset-mbr /usr/share/rhev-hypervisor/rhev-hypervisor.iso /dev/sdc
    Verifying image...
    /usr/share/rhev-hypervisor/rhev-hypervisor.iso:   eccc12a0530b9f22e5ba62b848922309
    Fragment sums: 8688f5473e9c176a73f7a37499358557e6c397c9ce2dafb5eca5498fb586
    Fragment count: 20
    Press [Esc] to abort check.
    Checking: 100.0%
    
    The media check is complete, the result is: PASS.
    
    It is OK to use this media.
    
    WARNING: THIS WILL DESTROY ANY DATA ON /dev/sdc!!!
    Press Enter to continue or ctrl-c to abort
    
    /dev/sdc: 2 bytes were erased at offset 0x000001fe (dos): 55 aa
    Waiting for devices to settle...
    mke2fs 1.42.7 (21-Jan-2013)
    Filesystem label=LIVE
    OS type: Linux
    Block size=4096 (log=2)
    Fragment size=4096 (log=2)
    Stride=0 blocks, Stripe width=0 blocks
    488640 inodes, 1953280 blocks
    97664 blocks (5.00%) reserved for the super user
    First data block=0
    Maximum filesystem blocks=2000683008
    60 block groups
    32768 blocks per group, 32768 fragments per group
    8144 inodes per group
    Superblock backups stored on blocks: 
            32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632
    
    Allocating group tables: done                            
    Writing inode tables: done                            
    Creating journal (32768 blocks): done
    Writing superblocks and filesystem accounting information: done 
    
    Copying live image to target device.
    squashfs.img
       163360768 100%  184.33MB/s    0:00:00 (xfer#1, to-check=0/1)
    
    sent 163380785 bytes  received 31 bytes  108920544.00 bytes/sec
    total size is 163360768  speedup is 1.00
    osmin.img
            4096 100%    0.00kB/s    0:00:00 (xfer#1, to-check=0/1)
    
    sent 4169 bytes  received 31 bytes  8400.00 bytes/sec
    total size is 4096  speedup is 0.98
    Updating boot config file
    Installing boot loader
    /media/tgttmp.q6aZdS/syslinux is device /dev/sdc
    Target device is now set up with a Live image!
    
Result
The Hypervisor disk image has been written to the USB storage device. You can now use it to boot a system and install the Hypervisor.

8.3.1.3. Preparing USB Installation Media Using dd

The dd command can also be used to install a hypervisor onto a USB storage device. Media created with the command can boot the Hypervisor on systems which support booting via USB. Red Hat Enterprise Linux provides dd as part of the coreutils package. Versions of dd are also available on a wide variety of Linux and Unix operating systems.
Windows users are able to obtain the dd command through installation of Red Hat Cygwin, a free Linux-like environment for Windows.
The basic dd command usage follows this structure:
# dd if=image of=device
Where the device parameter is the device name of the USB storage device to install to. The image parameter is a ISO image of the Hypervisor. The default hypervisor image location is /usr/share/rhev-hypervisor/rhev-hypervisor.iso. The dd command does not make assumptions as to the format of the device as it performs a low-level copy of the raw data in the selected image.

8.3.1.4. Preparing USB Installation Media Using dd on Linux Systems

Summary
The dd command available on most Linux systems is suitable for creating USB installation media, to boot and install the Hypervisor.

Procedure 8.3. Preparing USB Installation Media using dd on Linux Systems

  1. Install the rhev-hypervisor package.
    # yum install rhev-hypervisor
  2. Use the dd command to copy the image file to the disk.

    Example 8.2. Use of dd

    This example uses a USB storage device named /dev/sdc.
    # dd if=/usr/share/rhev-hypervisor/rhev-hypervisor.iso of=/dev/sdc
    243712+0 records in
    243712+0 records out
    124780544 bytes (125 MB) copied, 56.3009 s, 2.2 MB/s
    

    Warning

    The dd command will overwrite all data on the device specified for the of parameter. Any existing data on the device will be destroyed. Ensure that the correct device is specified and that it contains no valuable data before invocation of the dd command.
Result
The USB storage device is ready for use as Hypervisor installation media.

8.3.1.5. Preparing USB Installation Media Using dd on Windows Systems

Summary
The dd command, available on Windows systems with Red Hat Cygwin installed, is suitable for creating USB installation media to boot and install the Hypervisor.

Procedure 8.4. Preparing USB Installation Media using dd on Windows Systems

  1. Access http://www.redhat.com/services/custom/cygwin/ and click the Red Hat Cygwin official installation utility link. The rhsetup.exe executable will download.
  2. As the Administrator user run the downloaded rhsetup.exe executable. The Red Hat Cygwin installer will display.
  3. Follow the prompts to complete a standard installation of Red Hat Cygwin. The Coreutils package within the Base package group provides the dd utility. This is automatically selected for installation.
  4. Copy the rhev-hypervisor.iso file downloaded from Red Hat Network to C:\rhev-hypervisor.iso.
  5. As the Administrator user run Red Hat Cygwin from the desktop. A terminal window will appear.

    Important

    On the Windows 7 and Windows Server 2008 platforms it is necessary to right click the Red Hat Cygwin icon and select the Run as Administrator... option to ensure the application runs with the correct permissions.
  6. In the terminal run cat /proc/partitions to see the drives and partitions currently visible to the system.

    Example 8.3. View of Disk Partitions Attached to System

    Administrator@test /
    $ cat /proc/partitions
    major minor  #blocks  name
        8     0  15728640 sda
        8     1    102400 sda1
        8     2  15624192 sda2
  7. Plug the USB storage device which is to be used as the media for the Hypervisor installation into the system. Re-run the cat /proc/partitions command and compare the output to that of the previous run. A new entry will appear which designates the USB storage device.

    Example 8.4. View of Disk Partitions Attached to System

    Administrator@test /
    $ cat /proc/partitions
    major minor  #blocks  name
        8     0  15728640 sda
        8     1    102400 sda1
        8     2  15624192 sda2
        8    16    524288 sdb
    
  8. Use the dd command to copy the rhev-hypervisor.iso file to the disk. The example uses a USB storage device named /dev/sdb. Replace sdb with the correct device name for the USB storage device to be used.

    Example 8.5. Use of dd Command Under Red Hat Cygwin

    Administrator@test /
    $ dd if=/cygdrive/c/rhev-hypervisor.iso of=/dev/sdb& pid=$!
    
    The provided command starts the transfer in the background and saves the process identifier so that it can be used to monitor the progress of the transfer. Refer to the next step for the command used to check the progress of the transfer.

    Warning

    The dd command will overwrite all data on the device specified for the of parameter. Any existing data on the device will be destroyed. Ensure that the correct device is specified and that it contains no valuable data before invocation of the dd command.
  9. Transfer of the ISO file to the USB storage device with the version of dd included with Red Hat Cygwin can take significantly longer than the equivalent on other platforms.
    To check the progress of the transfer in the same terminal window that the process was started in send it the USR1 signal. This can be achieved by issuing the kill command in the terminal window as follows:
    kill -USR1 $pid
  10. When the transfer operation completes the final record counts will be displayed.

    Example 8.6. Result of dd Initiated Copy

    210944+0 records in
    210944+0 records out
    108003328 bytes (108 MB) copied, 2035.82 s, 53.1 kB/s
    
    [1]+    Done            dd if=/cygdrive/c/rhev-hypervisor.iso of=/dev/sdb
    
Result
The USB storage device is ready for use as Hypervisor installation media.