Using your own Linux OS image to create virtual system instances

IBM® provides various OS images that have been tested with imbedded pattern contents and are pre-optimized for performance and security considerations. However, in some cases you may want to use your own OS image. IBM OS Pattern Kit allows you to onboard your own operating system image in to PureApplication® System and transform that image by adding capabilities required for pattern-based deployment.

Before you begin

You must provide a virtual appliance OVA which consists of your basic operating system. The following operating systems are supported:
  • Red Hat Enterprise Linux (RHEL) 6.8 (64-bit), 6.9 (64-bit), and 6.10 (64-bit)
  • Red Hat Enterprise Linux (RHEL) 7.4 (64-bit) and 7.5 (64-bit)
Note: Red Hat Enterprise Linux (RHEL) 6.10 (64-bit) and 7.5 (64-bit) are supported in V2.2.5.3 only.

    You can create a new virtual machine in VMware using various methods. Whether you clone from an existing virtual machine, deploy from a template, or create your own, ensure that VMware Tools is installed on the virtual machine that you are using. To install VMware Tools on a running virtual machine in vSphere Client, left click the virtual machine, select Guest > Install/Upgrade VMware Tools and go to the virtual machine console to complete the installation.

    If you do not have a virtual appliance OVA, follow the steps in Creating OVA files to create an OVA which can be used in PureApplication System.

    About this task

    Follow these steps to create a virtual system instance using your own working operating system.

    Procedure

    1. Follow the steps in Adding virtual appliances to import your own base operating system image as a virtual appliance (OVA) in to PureApplication System.
    2. Follow the steps in Deploying virtual appliances to deploy the virtual appliance and create a running virtual machine.
      Important: When you export your own operating system image from VMware to then import and deploy it into PureApplication System, the image does not include Activation Engine. You can set the virtual machine configuration no_activation_engine option to true if you want to use VMware guest OS customization for automated network configuration. If your virtual appliance image is not compatible with VMware guest OS customization, you can set no_activation_engine to false and use the virtual machine console to configure your network later.
    3. Follow the steps in Starting and stopping virtual machines to start the virtual machine.
    4. If the IP address is unavailable after you have deployed the virtual appliance, follow these steps to configure the network:
      1. Access the PureApplication System console pane. Click Patterns > Virtual Machines. Select the virtual machine that you specified during the virtual appliance deployment step. The detailed information for that virtual machine is displayed.
      2. Scroll to IP addresses and record the IP address, Netmask, and Gateway of the virtual machine.
      3. Click the Console icon in the toolbar to establish a connection to the virtual machine console. You must have root access to configure the network.
      4. Run the following commands to configure the network:
        ifconfig eth1 <ip address> netmask <netmask> up
        route add default gw <gateway>
        Important: For Red Hat Enterprise Linux (RHEL) 7.0, if your network device name field is not defined as ethx, you must first run the following commands to disable consistent network device naming:
        sed -i 's/rhgb quiet/biosdevname=0 net.ifnames=0 rhgb quiet/' /etc/default/grub
        grub2-mkconfig -o /boot/grub2/grub.cfg
        shutdown -r now
        After the system reboot, the network device name field will appear as ethx and you can continue configuring the network.
    5. Configure and start SSH service to log in to the virtual machine.
    6. Download and install enablement packages for preferred supported systems.
    7. From the virtual machine, issue the following command to reset the virtual machine.
      AE.sh --reset
      This action will power off the virtual machine.
    8. Use one of the following procedures to create a new image of an existing virtual machine.
      Note: A virtual machine may be left in an unmanageable state if you perform this step against a virtual machine that is from a virtual system pattern deployment instead of a virtual appliance deployment. From the console, the virtual system instance will appear in the launching state but you will not be able to launch the instance. You should delete this virtual system instance.
      • Follow the steps in Creating virtual images from existing virtual machines.
      • Use the following CLI commands to create a new image of the virtual machine by specifying the new image name, version, virtual machine id (vmid), and the url to metadata OVA (using the corresponding metadata OVA).
        1. >>> vm=admin.virtualmachines.list({'name':'name_of_virtual_machine'})[0]
          where name_of_virtual_machine is the name of the virtual machine as deployed from the virtual appliance under consideration (or a partial name that can uniquely identify the virtual machine).
        2. >>> deployer.virtualimages.create({'url':'url_of_metadata_file','vmid':vm.id,'name':'name_of_virtual_image','version':'version_of_virtual_image','description':'description_of_virtual_image'})
          where
          • URL of the url_of_metadata_file is the URL of the metadata OVA file which your PureApplication System can access. You can provide the metadata OVA file in one of the following ways:
            • Download the metadata OVA file from the IBM DeveloperWorks website at: http://www.ibm.com/developerworks/downloads/ibm/ospatternkit/index.html.
            • Define an accessible ssh location using the following format:
               <IP address>:<full path and name of file>
              For example,
              172.15.16.244:/tmp/ova/MAESTRO_LINUX_OS_IMG_METADATA_2.1-11.ova
              Be sure to provide the correct user and password to connect to the ssh location.
          • name_of_virtual_image is the name given to the virtual image to be created.
          • version_of_virtual_image is the version of the provided virtual image.
          • description_of_virtual_image is the description of the provided virtual image.
        For example:
        >>> vm=admin.virtualmachines.list({'name':''My RHEL 6.5 VM 2''})[0
        >>> deployer.virtualimages.create({'url':'http://172.16.15.250/jobs/MAESTRO_LINUX_OS_IMG_METADATA_OVA/lastSuccessful/archive/MAESTRO_LINUX_OS_IMG_METADATA_2.1-11.ova','vmid':vm.id,'name':'BYOS RHEL 6.5','version':'1.0.0.0','description':'My RHEL 6.5 Image for pattern deploy'})]
        For example (when using ssh):
        >>> vm=admin.virtualmachines.list({'name':''My RHEL 6.5 VM 2''})[0
        >>> deployer.virtualimages.create({'url':'172.16.15.250:/jobs/MAESTRO_LINUX_OS_IMG_METADATA_OVA/lastSuccessful/archive/MAESTRO_LINUX_OS_IMG_METADATA_2.1-11.ova','vmid':vm.id,'name':'BYOS RHEL 6.5','version':'1.0.0.0','description':'My RHEL 6.5 Image for pattern deploy'})]
    9. Inspect the virtual image by following the steps in Viewing and modifying virtual images. Accept the license agreement if it has not yet been accepted.
    10. Once the new image is successfully created, verify the new image by creating a virtual system pattern using the image component from this new image. Follow steps in Creating virtual system patterns.

      Back to the top of the page.

    What to do next

    You can use the virtual image for virtual system and virtual application deployment. You do not have to repeat the above procedure to make changes to the image. See Extending and capturing virtual images to learn how to make changes to an image.