7.2. Modifying the Red Hat Enterprise Virtualization Hypervisor ISO

7.2.1. Introduction to Modifying the Red Hat Enterprise Virtualization Hypervisor ISO

While the Red Hat Enterprise Virtualization Hypervisor is designed as a closed, minimal operating system, you can use the edit-node tool to make specific changes to the Red Hat Enterprise Virtualization Hypervisor ISO file to address specific requirements. The tool extracts the file system from a livecd-based ISO file and modifies aspects of the image, such as user passwords, SSH keys, and the packages included.

Important

Any modifications must be repeated each time prior to upgrading a Hypervisor to a new version of the Red Hat Enterprise Virtualization Hypervisor ISO file.

Warning

In the event of an issue with a Red Hat Enterprise Virtualization Hypervisor that has been modified using the edit-node tool, you may be required to reproduce the issue in an unmodified version of the Red Hat Enterprise Virtualization Hypervisor as part of the troubleshooting process.

7.2.2. Installing the edit-node Tool

The edit-node tool is included in the ovirt-node-tools package provided by the Red Hat Enterprise Virtualization Hypervisor repository.

Procedure 7.2. Installing the edit-node Tool

  1. Log in to the system on which to modify the Red Hat Enterprise Virtualization Hypervisor ISO file.
  2. Enable the required repository:
    • For Red Hat Enterprise Linux 6:
      # subscription-manager repos --enable=rhel-6-server-rhevh-rpms
    • For Red Hat Enterprise Linux 7:
      # subscription-manager repos --enable=rhel-7-server-rhevh-rpms
  3. Install the ovirt-node-tools package:
    # yum install ovirt-node-tools
You have installed the edit-node tool required for modifying the Red Hat Enterprise Virtualization Hypervisor ISO file. Proceed to the next section to see how to use the tool.

7.2.3. Syntax of the edit-node Tool

The basic options for the edit-node tool are as follows:

Options for the edit-node Tool

--name=image_name
Specifies the name of the modified image.
--output=directory
Specifies the directory to which the edited ISO is saved.
--kickstart=kickstart_file
Specifies the path or URL to and name of a kickstart configuration file.
--script=script
Specifies the path to and name of a script to run in the image.
--shell
Opens an interactive shell with which to edit the image.
--passwd=user,encrypted_password
Defines a password for the specified user. This option accepts MD5-encrypted password values. The --password parameter can be specified multiple times to modify multiple users. If no user is specified, the default user is admin.
--sshkey=user,public_key_file
Specifies the public key for the specified user. This option can be specified multiple times to specify keys for multiple users. If no user is specified, the default user is admin.
--uidmod=user,uid
Specifies the user ID for the specified user. This option can be specified multiple times to specify IDs for multiple users.
--gidmod=group,gid
Specifies the group ID for the specified group. This option can be specified multiple times to specify IDs for multiple groups.
--tmpdir=temporary_directory
Specifies the temporary directory on the local file system to use. By default, this value is set to /var/tmp
--releasefile=release_file
Specifies the path to and name of a release file to use for branding.
--builder=builder
Specifies the builder of a remix.
--install-plugin=plugin
Specifies a list of plug-ins to install in the image. You can specify multiple plug-ins by separating the plug-in names using a comma.
--install=package
Specifies a list of packages to install in the image. You can specify multiple packages by separating the package names using a comma.
--install-kmod=package_name
Installs the specified driver update package from a yum repository or specified .rpm file. Specified .rpm files are valid only if in whitelisted locations (kmod-specific areas).
--repo=repository
Specifies the yum repository to be used in conjunction with the --install-* options. The value specified can be a local directory, a yum repository file (.repo), or a driver disk .iso file.
--nogpgcheck
Skips GPG key verification during the yum install stage. This option allows you to install unsigned packages.

Manifest Options for the edit-node Tool

--list-plugins
Prints a list of plug-ins added to the image.
--print-version
Prints current version information from /etc/system-release.
--print-manifests
Prints a list of manifest files in the ISO file.
--print-manifest=manifest
Prints the specified manifest file.
--get-manifests=manifest
Creates a .tar file of manifest files in the ISO file.
--print-file-manifest
Prints the contents of rootfs on the ISO file.
--print-rpm-manifest
Prints a list of installed packages in rootfs on the ISO file.

Debugging Options for the edit-node Tool

--debug
Prints debugging information when the edit-node command is run.
--verbose
Prints verbose information regarding the progress of the edit-node command.
--logfile=logfile
Specifies the path to and name of a file in which to print debugging information.

7.2.4. Adding and Updating Packages

You can use the edit-node tool to add new packages to or update existing packages in the Red Hat Enterprise Virtualization Hypervisor ISO file. To add or update a single package, you must either set up a local directory to act as a repository for the required package and its dependencies or point the edit-node tool to the location of a repository definition file that defines one or more repositories that provide the package and its dependencies. To add or update multiple packages, you must point the edit-node tool to the location of a repository definition file that defines one or more repositories that provide the packages and their dependencies.

Note

If you include a definition for a local repository in a repository definition file, the directory that acts as the source for that repository must be exposed via a web server or an FTP server. For example, it must be possible to access the repository via a link such as http://localhost/myrepo/ or ftp://localhost/myrepo/.

Important

The edit-node tool cannot download packages from repositories that use SSL. Instead, you must manually download each package and its dependencies and create a local repository that contains those packages.

7.2.4.1. Creating a Local Repository

To add packages to the Red Hat Enterprise Virtualization Hypervisor ISO file, you must set up a directory to act as a repository for installing those packages using the createrepo tool provided by the base Red Hat Enterprise Linux Workstation and Red Hat Enterprise Linux Server repositories.

Procedure 7.3. Creating a Local Repository

  1. Install the createrepo package and dependencies on the system on which to modify the Red Hat Enterprise Virtualization Hypervisor ISO file:
    # yum install createrepo
  2. Create a directory to serve as the repository.
    # mkdir exampleLocalrepo
  3. Copy all required packages and their dependencies into the newly created directory.
  4. Set up the metadata files for that directory to act as a repository:
    # createrepo exampleLocalrepo
You have created a local repository for installing the required packages and their dependencies in the Red Hat Enterprise Virtualization Hypervisor ISO file. Proceed to the next section to add packages to the Red Hat Enterprise Virtualization Hypervisor ISO file.

7.2.4.2. Example: Adding Packages to the Red Hat Enterprise Virtualization Hypervisor ISO File

Use the edit-node tool to add packages to the Red Hat Enterprise Virtualization Hypervisor ISO file. This action creates a copy of the ISO file in the directory from which the edit-node tool was run that includes the name of the newly added packages in its name.
The following example adds a single package to the Red Hat Enterprise Virtualization Hypervisor ISO file, using a directory configured to act as a local repository as the source from which to install the package:

Example 7.2. Adding a Single Package to the Red Hat Enterprise Virtualization Hypervisor ISO File

# edit-node --nogpgcheck --install package1 --repo exampleLocalrepo /usr/share/rhev-hypervisor/rhevh-latest-7.iso
You can add multiple packages by enclosing a comma-separated list of package names in double quotation marks. The following example adds two packages to the Red Hat Enterprise Virtualization Hypervisor ISO file, using a directory configured to act as a local repository as the source from which to install the packages:

Example 7.3. Adding Multiple Packages to the Red Hat Enterprise Virtualization Hypervisor ISO File

# edit-node --nogpgcheck --install "package1,package2" --repo  exampleLocalrepo /usr/share/rhev-hypervisor/rhevh-latest-7.iso

7.2.4.3. Example: Updating Packages in the Red Hat Enterprise Virtualization Hypervisor ISO File

You can use the edit-node tool to update existing packages in the Red Hat Enterprise Virtualization Hypervisor ISO file. This action creates a copy of the ISO file in the directory from which the edit-node tool was run that includes the names of the updated packages in its name.
The following example updates the vdsm package in the Red Hat Enterprise Virtualization Hypervisor ISO file, using a repository file containing the details of the Red Hat Enterprise Virtualization Hypervisor repository:

Example 7.4. Updating a Single Package in the Red Hat Enterprise Virtualization Hypervisor ISO File

# edit-node --nogpgcheck --install vdsm --repo /etc/yum.repos.d/rhevh.repo /usr/share/rhev-hypervisor/rhevh-latest-7.iso
You can update multiple packages by enclosing a comma-separated list of package names in double quotation marks. The following example updates the vdsm and libvirt packages in the Red Hat Enterprise Virtualization Hypervisor ISO file, using a repository file containing the details of the Red Hat Enterprise Virtualization Hypervisor repository:

Example 7.5. Updating Multiple Packages in the Red Hat Enterprise Virtualization Hypervisor ISO File

# edit-node --nogpgcheck --install "vdsm,libvirt" --repo /etc/yum.repos.d/rhevh.repo /usr/share/rhev-hypervisor/rhevh-latest-7.iso

7.2.5. Modifying the Default ID of Users and Groups

7.2.5.1. Example: Modifying the Default ID of a User

You can use the edit-node tool to modify the default ID of a user in the Red Hat Enterprise Virtualization Hypervisor ISO file.
The following example changes the default ID of the user user1 to 60:

Example 7.6. Modifying the Default ID of a Single User

# edit-node --uidmod=user1,60
You can modify the default ID of multiple users by specifying the --uidmod option multiple times in the same command. The following example changes the default ID of the user user1 to 60 and the default ID of the user user2 to 70.

Example 7.7. Modifying the Default ID of Multiple Users

# edit-node --uidmod=user1,60 --uidmod=user2,70

7.2.5.2. Example: Modifying the Default ID of a Group

You can use the edit-node tool to modify the default ID of a group in the Red Hat Enterprise Virtualization Hypervisor ISO file.
The following example changes the default ID of the group group1 to 60:

Example 7.8. Modifying the Default ID of a Single Group

# edit-node --gidmod=group1,60
You can modify the default ID of multiple groups by specifying the --gidmod option multiple times in the same command. The following example changes the default ID of the group group1 to 60 and the default ID of the group group2 to 70.

Example 7.9. Modifying the Default ID of Multiple Groups

# edit-node --gidmod=group1,60 --gidmod=group2,70