Administering Hosts
This chapter describes creating, registering, administering, and removing hosts.
Creating a Host in orcharhino
Use this procedure to create a host in orcharhino. To use the CLI instead of the orcharhino management UI, see the CLI procedure.
-
In the orcharhino management UI, click Hosts > Create Host.
-
On the Host tab, enter the required details.
-
Click the Ansible Roles tab, and from the Ansible Roles list, select one or more roles that you want to add to the host. Use the arrow icon to manage the roles that you add or remove.
-
On the Puppet Classes tab, select the Puppet classes you want to include.
-
On the Interfaces tab:
-
For each interface, click Edit in the Actions column and configure the following settings as required:
-
Type — For a Bond or BMC interface, use the Type list and select the interface type.
-
MAC address — Enter the MAC address.
-
DNS name — Enter the DNS name that is known to the DNS server. This is used for the host part of the FQDN.
-
Domain — Select the domain name of the provisioning network. This automatically updates the Subnet list with a selection of suitable subnets.
-
IPv4 Subnet — Select an IPv4 subnet for the host from the list.
-
IPv6 Subnet — Select an IPv6 subnet for the host from the list.
-
IPv4 address — If IP address management (IPAM) is enabled for the subnet, the IP address is automatically suggested. Alternatively, you can enter an address. The address can be omitted if provisioning tokens are enabled, if the domain does not mange DNS, if the subnet does not manage reverse DNS, or if the subnet does not manage DHCP reservations.
-
IPv6 address — If IP address management (IPAM) is enabled for the subnet, the IP address is automatically suggested. Alternatively, you can enter an address.
-
Managed — Select this checkbox to configure the interface during provisioning to use the orcharhino Proxy provided DHCP and DNS services.
-
Primary — Select this checkbox to use the DNS name from this interface as the host portion of the FQDN.
-
Provision — Select this checkbox to use this interface for provisioning. This means TFTP boot will take place using this interface, or in case of image based provisioning, the script to complete the provisioning will be executed through this interface. Note that many provisioning tasks, such as downloading RPMs by anaconda, Puppet setup in a
%post
script, will use the primary interface. -
Virtual NIC — Select this checkbox if this interface is not a physical device. This setting has two options:
-
Tag — Optionally set a VLAN tag. If unset, the tag will be the VLAN ID of the subnet.
-
Attached to — Enter the device name of the interface this virtual interface is attached to.
-
-
-
Click OK to save the interface configuration.
-
Optionally, click Add Interface to include an additional network interface. For more information, see Adding Network Interfaces.
-
Click Submit to apply the changes and exit.
-
-
On the Operating System tab, enter the required details. For Red Hat operating systems, select Synced Content for Media Selection. If you want to use non Red Hat operating systems, select All Media, then select the installation media from the Media Selection list. You can select a partition table from the list or enter a custom partition table in the Custom partition table field. You cannot specify both.
-
On the Parameters tab, click Add Parameter to add any parameter variables that you want to pass to job templates at run time. This includes all Puppet Class, Ansible playbook parameters and host parameters that you want to associate with the host. To use a parameter variable with an Ansible job template, you must add a Host Parameter.
If you want to create a host with pull mode for remote job execution, add the
enable-remote-execution-pull
parameter with typeboolean
set totrue
. For more information, see transport modes for remote execution. -
On the Additional Information tab, enter additional information about the host.
-
Click Submit to complete your provisioning request.
-
To create a host associated to a host group, enter the following command:
#Â hammer host create \ --name "My_Host_Name" \ --hostgroup "My_Host_Group" \ --interface="primary=true, \ provision=true, \ mac=mac_address, \ ip=ip_address" \ --organization "My_Organization" \ --location "My_Location" \ --ask-root-password yes
This command prompts you to specify the root password. It is required to specify the host’s IP and MAC address. Other properties of the primary network interface can be inherited from the host group or set using the
--subnet
, and--domain
parameters. You can set additional interfaces using the--interface
option, which accepts a list of key-value pairs. For the list of available interface settings, enter thehammer host create --help
command.
Cloning Hosts
You can clone existing hosts.
-
In the orcharhino management UI, navigate to Hosts > All Hosts.
-
In the Actions menu, click Clone.
-
On the Host tab, ensure to provide a Name different from the original host.
-
On the Interfaces tab, ensure to provide a different IP address.
-
Click Submit to clone the host.
For more information, see Creating a Host.
Creating a Host Group
If you create a high volume of hosts, many of the hosts can have common settings and attributes. Adding these settings and attributes for every new host is time consuming. If you use host groups, you can apply common attributes to hosts that you create.
A host group functions as a template for common host settings, containing many of the same details that you provide to hosts. When you create a host with a host group, the host inherits the defined settings from the host group. You can then provide additional details to individualize the host.
To use the CLI instead of the orcharhino management UI, see the CLI procedure.
You can create a hierarchy of host groups. Aim to have one base level host group that represents all hosts in your organization and provide general settings, and then nested groups to provide specific settings. For example, you can have a base level host group that defines the operating system, and two nested host groups that inherit the base level host group:
-
Hostgroup:
Base
(Ubuntu 8.8)-
Hostgroup:
Webserver
(applies thenginx
Puppet class)-
Host:
webserver1.example.com
(web server) -
Host:
webserver2.example.com
(web server)
-
-
Hostgroup:
Storage
(applies thenfs
Puppet class)-
Host:
storage1.example.com
(storage server) -
Host:
storage2.example.com
(storage server)
-
-
Host:
custom.example.com
(custom host)
-
In this example, all hosts use Ubuntu 7.6 as their operating system because of their inheritance of the Base
host group.
The two web server hosts inherit the settings from the Webserver
host group, which includes the nginx
Puppet class and the settings from the Base
host group.
The two storage servers inherit the settings from the Storage
host group, which includes the nfs
Puppet class and the settings from the Base
host group.
The custom host only inherits the settings from the Base
host group.
-
In the orcharhino management UI, navigate to Configure > Host Groups and click Create Host Group.
-
If you have an existing host group that you want to inherit attributes from, you can select a host group from the Parent list. If you do not, leave this field blank.
-
Enter a Name for the new host group.
-
Enter any further information that you want future hosts to inherit.
-
Click the Ansible Roles tab, and from the Ansible Roles list, select one or more roles that you want to add to the host. Use the arrow icon to manage the roles that you add or remove.
-
Click the additional tabs and add any details that you want to attribute to the host group.
Puppet fails to retrieve the Puppet CA certificate while registering a host with a host group associated with a Puppet environment created inside a
Production
environment.To create a suitable Puppet environment to be associated with a host group, manually create a directory:
# mkdir /etc/puppetlabs/code/environments/example_environment
-
Click Submit to save the host group.
-
Create the host group with the
hammer hostgroup create
command. For example:# hammer hostgroup create --name "Base" \ --architecture "My_Architecture" \ --content-source-id _My_Content_Source_ID_ \ --content-view "_My_Content_View_" \ --domain "_My_Domain_" \ --lifecycle-environment "_My_Lifecycle_Environment_" \ --locations "_My_Location_" \ --medium-id _My_Installation_Medium_ID_ \ --operatingsystem "_My_Operating_System_" \ --organizations "_My_Organization_" \ --partition-table "_My_Partition_Table_" \ --puppet-ca-proxy-id _My_Puppet_CA_Proxy_ID_ \ --puppet-environment "_My_Puppet_Environment_" \ --puppet-proxy-id _My_Puppet_Proxy_ID_ \ --root-pass "My_Password" \ --subnet "_My_Subnet_"
Creating a Host Group for Each Lifecycle Environment
Use this procedure to create a host group for the Library lifecycle environment and add nested host groups for other lifecycle environments.
To create a host group for each life cycle environment, run the following Bash script:
MAJOR="My_Major_OS_Version"
ARCH="My_Architecture"
ORG="My_Organization"
LOCATIONS="My_Location"
PTABLE_NAME="My_Partition_Table"
DOMAIN="My_Domain"
hammer --output csv --no-headers lifecycle-environment list --organization "${ORG}" | cut -d ',' -f 2 | while read LC_ENV; do
[[ ${LC_ENV} == "Library" ]] && continue
hammer hostgroup create --name "rhel-${MAJOR}server-${ARCH}-${LC_ENV}" \
--architecture "${ARCH}" \
--partition-table "${PTABLE_NAME}" \
--domain "${DOMAIN}" \
--organizations "${ORG}" \
--query-organization "${ORG}" \
--locations "${LOCATIONS}" \
--lifecycle-environment "${LC_ENV}"
done
Changing the Host Group of a Host
Use this procedure to change the Host Group of a host.
If you reprovision a host after changing the host group, the fresh values that the host inherits from the host group will be applied.
-
In the orcharhino management UI, navigate to Hosts > All Hosts.
-
Click the name of the host you want to modify.
-
Click the Edit button.
-
Select the new host group from the Host Group list.
-
Click Submit.
-
The Details card under the Overview tab now shows the host group your host belongs to.
Changing the Environment of a Host
Use this procedure to change the environment of a host.
-
In the orcharhino management UI, navigate to Hosts > All Hosts.
-
Click the name of the host you want to modify.
-
Click the vertical ellipsis in the Content view details card and select Edit content view assignment.
-
Select the environment.
-
Select the content view.
-
Click Save.
Changing the Managed Status of a Host
Hosts provisioned by orcharhino are Managed by default. When a host is set to Managed, you can configure additional host parameters from orcharhino Server. These additional parameters are listed on the Operating System tab. If you change any settings on the Operating System tab, they will not take effect until you set the host to build and reboot it.
If you need to obtain reports about configuration management on systems using an operating system not supported by orcharhino, set the host to Unmanaged.
-
In the orcharhino management UI, navigate to Hosts > All Hosts.
-
Click the name of the host you want to modify.
-
Click the Edit button.
-
Click Manage host or Unmanage host to change the host’s status.
-
Click Submit.
Assigning a Host to a Specific Organization
Use this procedure to assign a host to a specific organization. For general information about organizations and how to configure them, see Managing Organizations in Managing Organizations and Locations.
If your host is already registered with a different organization, you must first unregister the host before assigning it to a new organization.
To unregister the host, run |
-
In the orcharhino management UI, navigate to Hosts > All Hosts.
-
Select the checkbox of the host you want to change.
-
From the Select Action list, select Assign Organization. A new option window opens.
-
From the Select Organization list, select the organization that you want to assign your host to. Select the checkbox Fix Organization on Mismatch.
A mismatch happens if there is a resource associated with a host, such as a domain or subnet, and at the same time not associated with the organization you want to assign the host to. The option Fix Organization on Mismatch will add such a resource to the organization, and is therefore the recommended choice. The option Fail on Mismatch will always result in an error message. For example, reassigning a host from one organization to another will fail, even if there is no actual mismatch in settings.
-
Click Submit.
Assigning a Host to a Specific Location
Use this procedure to assign a host to a specific location. For general information about locations and how to configure them, see Creating a Location in Managing Content.
-
In the orcharhino management UI, navigate to Hosts > All Hosts.
-
Select the checkbox of the host you want to change.
-
From the Select Action list, select Assign Location. A new option window opens.
-
Navigate to the Select Location list and choose the location that you want for your host. Select the checkbox Fix Location on Mismatch.
A mismatch happens if there is a resource associated with a host, such as a domain or subnet, and at the same time not associated with the location you want to assign the host to. The option Fix Location on Mismatch will add such a resource to the location, and is therefore the recommended choice. The option Fail on Mismatch will always result in an error message. For example, reassigning a host from one location to another will fail, even if there is no actual mismatch in settings.
-
Click Submit.
Removing a Host from orcharhino
Use this procedure to remove a host from orcharhino.
-
In the orcharhino management UI, navigate to Hosts > All Hosts or Hosts > Content Hosts. Note that there is no difference from what page you remove a host, from All Hosts or Content Hosts. In both cases, orcharhino removes a host completely.
-
Select the hosts that you want to remove.
-
From the Select Action list, select Delete Hosts.
-
Click Submit to remove the host from orcharhino permanently.
By default, the To delete a virtual machine on the compute resource, navigate to Administer > Settings and select the Provisioning tab.
Setting |
Installing the Snapshot Management Plug-in
Perform the following step to install the Snapshot Management plug-in on your orcharhino.
-
Install the Snapshot Management plug-in on your orcharhino Server:
# orcharhino-installer --enable-foreman-plugin-snapshot-management
Creating Snapshots of a Managed Host
You can use the Snapshot Management plug-in to create snapshots of managed hosts.
-
You have installed the Snapshot Management plug-in successfully. For more information, see Installing the Snapshot Management Plugin.
-
Your managed host is running on VMware vSphere or Proxmox.
-
In the orcharhino management UI, navigate to Hosts > All Hosts and select a host.
-
In the Snapshots card, click Create Snapshot.
-
Enter a Name.
-
Optional: Enter a Description.
-
Optional: In the Snapshot Mode field, select Memory if you want to include the RAM in your snapshot or Quiecse if you want to ensure the full state of the VM is written to disk before creating the snapshot.
-
Click Submit to create a snapshot.
Keeping more than three snapshots per host slows down the creation and rollback process. Consider deleting older snapshots when creating new ones. |
Disassociating A Virtual Machine from orcharhino without Removing It from a Hypervisor
-
In the orcharhino management UI, navigate to Hosts > All Hosts and select the checkbox to the left of the hosts to be disassociated.
-
From the Select Action list, select the Disassociate Hosts button.
-
Optional: Select the checkbox to keep the hosts for future action.
-
Click Submit.
The text and illustrations on this page are licensed by ATIX AG under a Creative Commons Attribution–Share Alike 3.0 Unported ("CC-BY-SA") license. This page also contains text from the official Foreman documentation which uses the same license ("CC-BY-SA"). |