Red Hat Training

A Red Hat training course is available for Red Hat Satellite

10.3. Working With Your Virtual Systems

Once you have set up your virtual system, you can then manage and customize them via various methods, including connecting via SSH and via the virtualization management interface on the host system.

10.3.1. Logging into Virtual Systems Directly via SSH

  1. You will need to locate the virtual system's IP address. Locate it by navigating to the SystemsVirtual Systems tab and clicking on the virtual system's profile name.
  2. On the virtual system's profile page, you'll find the IP address in the left-hand informational column in the IP Address field.
  3. Connect to the IP address by using ssh as root, using the password you set for the virtual system in the kickstart profile you created for it earlier.

10.3.2. Gaining Console Access Via the Host

  1. First you will need to connect to the host system and determine the ID number of the guest you would like to work with. Connect to the host system via ssh and run the following command:
    xm list
    
    This should provide you with a list all of the guests you created on your Satellite, including their ID number. look for the guest, guest1, that we created earlier in this list. If, for example, this guest has been assigned an ID of 2, then:
  2. Run the following command to access the console of this virtual system:
    xm console 2
    
    You should immediately be able to view a login prompt on guest1.
  3. Login to guest1 as root using the same password you set in the kickstart profile you used to provision the system.
    (There may be some messages on the screen. In this case, hit the Enter key on your keyboard to receive a fresh login prompt.)
  4. To exit the guest console and return to the host system's command prompt, you may hit the Ctrl and ] keys on your keyboard simultaneously.

10.3.3. Installing Software Via the Satellite Web Interface

  1. Browse to the virtual system's profile in your Satellite's web interface by logging in and navigating to SystemsSystemsVirtual Systems and clicking on the name of your virtual system's profile.
  2. In the virtual system's profile, click on the SoftwarePackages tab.
  3. Click on Install New Packages in the Packages tab menu.
  4. Select the packages you wish to install and click the Install Selected Packages button in the lower right-hand corner of the screen.
  5. Review the package install details and click on the Confirm button in the lower right-hand corner of the screen.
  6. The package install will take place the next time the guest system checks in with the Satellite. To force the install to take place immediately, you may run the rhn_check command on the guest system.

10.3.4. Installing Software Via Yum From the Virtual System

Your virtual system registered to your Satellite as part of the guest provisioning process, so you may simply use the yum command to install and update software. For example, to install the text editor vim, issue the following command:
yum install -y vim-enhanced

10.3.5. Restarting Guests when Host Reboots

By default, when a host system reboots, the guests are not restarted and must be manually started by the administrator.
However, the rhn-virtualization-host service can restart guests automatically in the event of a host system reboot.
To use this service, follow these steps:
  1. Locate the guest's config file on the host in /etc/sysconfig/rhn/virt/. It will be named by UUID, but the correct file can be found by using the grep command to search for the guest name within the UUID files.
  2. When you have found the UUID file corresponding to your guest system, create a symbolic link from the UUID file to the /etc/sysconfig/rhn/virt/auto/ directory.
    ln -s /etc/sysconfig/rhn/virt/GUEST_UUID.xml /etc/sysconfig/rhn/virt/auto/
    

10.3.6. Deleting Virtual Systems

Deleting a virtual system is a multi-step process.
  1. First you must shut down the virtual system that you wish to delete. You may do this by browsing to the host system's profile in the Satellite web interface, clicking on the virtualization tab, and checking off the virtual systems that you would like to delete. Finish shutting down by clicking the Shutdown Systems button at the bottom of the screen.
  2. Next, delete the virtual system from Satellite. This is accomplished by checking off the virtual system's checkbox and clicking the Delete System button at the bottom of the screen>

    Note

    Please allow for at least two minutes between shutting down a virtual system and deleting it. Otherwise, the virtual system may not shut down properly and you will delete it while it is running. If you delete a virtual system from Satellite while it is running, it will reappear on the Satellite the next time it checks in. If this happens, simply shutdown the system, wait two minutes, and delete it again.
  3. Delete the disk image for the virtual system you would like to delete. You will find the disk image for guest1, for example, at the following location on the host system:
    /var/lib/xen/disk-images/guest1.disk
    
    Delete it with the following command:
    rm /var/lib/xen/disk-images/guest1.disk
    
  4. Finally, you must delete the RHN configuration files from the host system. To locate the RHN configuration file for guest1, run the following command:
    grep guest1 /etc/sysconfig/rhn/virt/*.xml
    
    Then delete the file indicated. For example:
    rm /etc/sysconfig/rhn/virt/14e5cfbf72342515236ad74b260c2f6b.xml
    
  5. You have successfully deleted a guest system from your host system and from Satellite.