7.8. Modifying the Red Hat Enterprise Virtualization Hypervisor ISO
7.8.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.8.2. Installing the edit-node Tool
Summary
The edit-node tool is included in the ovirt-node-tools package provided by the Red Hat Enterprise Virtualization Hypervisor channel.
Procedure 7.26. Installing the edit-node Tool
- Log in to the system on which to modify the Red Hat Enterprise Virtualization Hypervisor ISO file.
- Enable the
Red Hat Enterprise Virtualization Hypervisor (v.6 x86_64)repository. With Subscription Manager, attach aRed Hat Enterprise Virtualizationentitlement and run the following command:# subscription-manager repos --enable=rhel-6-server-rhevh-rpms
- Install the ovirt-node-tools package:
# yum install ovirt-node-tools
Result
You have installed the edit-node tool required for modifying the Red Hat Enterprise Virtualization Hypervisor ISO file.
7.8.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
--passwordparameter can be specified multiple times to modify multiple users. If no user is specified, the default user isadmin. --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
.rpmfile. Specified.rpmfiles 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.isofile. --nogpgcheck- Skips GPG key verification during the
yum installstage. 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
.tarfile of manifest files in the ISO file. --print-file-manifest- Prints the contents of
rootfson the ISO file. --print-rpm-manifest- Prints a list of installed packages in
rootfson 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.8.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.8.4.1. Creating a Local Repository
Summary
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 channels.
Procedure 7.27. Creating a Local Repository
- Install the createrepo package and dependencies on the system on which to modify the Red Hat Enterprise Virtualization Hypervisor ISO file:
# yum install createrepo
- Create a directory to serve as the repository.
- Copy all required packages and their dependencies into the newly created directory.
- Set up the metadata files for that directory to act as a repository:
# createrepo [directory_name]
Result
You have created a local repository for installing the required packages and their dependencies in the Red Hat Enterprise Virtualization Hypervisor ISO file.
7.8.4.2. Example: Adding Packages to the Red Hat Enterprise Virtualization Hypervisor ISO File
You can 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.19. Adding a Single Package to the Red Hat Enterprise Virtualization Hypervisor ISO File
# edit-node --nogpgcheck --install package1 --repo ./local_repo /usr/share/rhev-hypervisor/rhevh-latest-6.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.20. Adding Multiple Packages to the Red Hat Enterprise Virtualization Hypervisor ISO File
# edit-node --nogpgcheck --install "package1,package2" --repo ./local_repo /usr/share/rhev-hypervisor/rhevh-latest-6.iso
7.8.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.21. 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-6.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.22. 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-6.iso
7.8.5. Modifying the Default ID of Users and Groups
7.8.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:
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.24. Modifying the Default ID of Multiple Users
# edit-node --uidmod=user1,60 --uidmod=user2,70
7.8.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:
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.26. Modifying the Default ID of Multiple Groups
# edit-node --gidmod=group1,60 --gidmod=group2,70