<commit_before>Virtual Environment
===================

RDO-Manager can be used in a virtual environment using virtual machines instead
of actual baremetal. However, one baremetal machine is still
needed to act as the host for the virtual machines.


Minimum System Requirements
---------------------------
By default, this setup creates 3 virtual machines:

* 1 Undercloud
* 1 Overcloud Controller
* 1 Overcloud Compute

Each virtual machine must consist of at least 4 GB of memory and 40 GB of disk
space [#]_.

.. note::
   The virtual machine disk files are thinly provisioned and will not take up
   the full 40GB initially.

The baremetal machine must meet the following minimum system requirements:

* Virtualization hardware extenstions enabled (nested KVM is **not** supported)
* 1 quad core CPU
* 12 GB free memory
* 120 GB disk space

..
    <REMOVE WHEN HA IS AVAILABLE>

    For minimal **HA (high availability)** deployment you need at least 3 Overcloud
    Controllers and 2 Overcloud Computes which increases the minimum system
    requirements up to:

    * 24 GB free memory
    * 240 GB disk space.

RDO-Manager is supporting only the following operating systems:

* RHEL 7.1 x86_64 or
* CentOS 7 x86_64


.. _preparing_virtual_environment:

Preparing the Virtual Environment (Automated)
---------------------------------------------

#. Install RHEL 7.1 Server x86_64 or CentOS 7 x86_64 on your host machine.

   .. only:: external

      .. admonition:: RHEL Portal Registration
         :class: portal

         Register the host machine using Subscription Management.::

             sudo subscription-manager register --username="[your username]" --password="[<PASSWORD>]"
             # Find this with `subscription-manager list --available`
             sudo subscription-manager attach --pool="[pool id]"
             # Verify repositories are available
             sudo subscription-manager repos --list
             # Enable repositories needed
             sudo subscription-manager repos --enable=rhel-7-server-rpms \
                  --enable=rhel-7-server-optional-rpms --enable=rhel-7-server-extras-rpms \
                  --enable=rhel-7-server-openstack-6.0-rpms

      .. admonition:: RHEL Satellite Registration
         :class: satellite

         To register the host machine to a Satellite, the following repos must
         be synchronized on the Satellite::

             rhel-7-server-rpms
             rhel-7-server-optional-rpms
             rhel-7-server-extras-rpms
             rhel-7-server-openstack-6.0-rpms


         See the `Red Hat Satellite User Guide`_ for how to configure the system to
         register with a Satellite server. It is suggested to use an activation
         key that automatically enables the above repos for registered systems.


#. Make sure sshd service is installed and running.


#. The user performing all of the installation steps on the virt host needs to
   have sudo enabled. You can use an existing user or use the following commands
   to create a new user called stack with password-less sudo enabled. Do not run
   the rest of the steps in this guide as root.

   * Example commands to create a user::

       sudo useradd stack
       sudo passwd stack  # specify a password
       echo "stack ALL=(root) NOPASSWD:ALL" | sudo tee -a /etc/sudoers.d/stack
       sudo chmod 0440 /etc/sudoers.d/stack


#. Make sure you are logged in as the non-root user you intend to use.

   * Example commands to log in as the non-root user::

       su - stack


#. Enable needed repositories:

   .. only:: internal

      .. admonition:: RHEL
         :class: rhel

          Enable rhos-release::

              sudo rpm -ivh http://rhos-release.virt.bos.redhat.com/repos/rhos-release/rhos-release-latest.noarch.rpm

              # Enable either poodles or puddles:
              # To enable poodles:
              sudo rhos-release 7-director -d
              # To enable puddles:
              sudo rhos-release 7-director

              # We need openwsman-python from the optional repo
              sudo yum install -y yum-utils
              sudo yum-config-manager --enable rhelosp-rhel-7-server-opt

   .. note::
     If testing RDO as opposed to RHOS, you need to enable some extra
     repositories:

     ::

         # Enable RDO Kilo
         sudo yum install -y https://rdoproject.org/repos/openstack-kilo/rdo-release-kilo.rpm

         # Enable RDO-Manager Trunk
         sudo curl -o /etc/yum.repos.d/rdo-management-trunk.repo http://trunk-mgt.rdoproject.org/centos-kilo/current-passed-ci/delorean-rdo-management.repo

     The above RDO-Manager Trunk repo is updated after a successful CI run. The following repo can be used instead if the newest packages are needed before a CI run has passed.

     ::

       sudo curl -o /etc/yum.repos.d/rdo-management-trunk.repo http://trunk-mgt.rdoproject.org/centos-kilo/current/delorean-rdo-management.repo


#. Install instack-undercloud::

    sudo yum install -y instack-undercloud

#. The virt setup automatically sets up a vm for the Undercloud installed with
   the same base OS as the host. See the Note below to choose a different
   OS.:

   .. note::
      To setup the undercloud vm with a base OS different from the host,
      set the ``$NODE_DIST`` environment variable prior to running
      ``instack-virt-setup``:

      .. admonition:: CentOS
         :class: centos

         ::

             export NODE_DIST=centos7

      .. admonition:: RHEL
         :class: rhel

         ::

             export NODE_DIST=rhel7


#. Run the script to setup your virtual environment:

   .. only:: internal

      .. admonition:: RHEL
         :class: rhel

         Download the RHEL 7.1 cloud image or copy it over from a different
         location, and define the needed environment variables for RHEL 7.1 prior
         to running ``instack-virt-setup``::

             IMAGE=http://download.devel.redhat.com/brewroot/packages/rhel-guest-image/7.1/20150224.0/images/rhel-guest-image-7.1-20150224.0.x86_64.qcow2
             curl -O $IMAGE
             export DIB_LOCAL_IMAGE=`basename $IMAGE`
             export DIB_YUM_REPO_CONF="/etc/yum.repos.d/rhos-release-7-director-rhel-7.1.repo /etc/yum.repos.d/rhos-release-7-rhel-7.1.repo"


   .. only:: external

      .. admonition:: RHEL
         :class: rhel

         Download the RHEL 7.1 cloud image or copy it over from a different
         location, for example: https://access.redhat.com/downloads/content/69/ver=/rhel---7/7.1/x86_64/product-downloads,
         and define the needed environment variables for RHEL 7.1 prior to
         running ``instack-virt-setup``::<commit_msg>Document NODE_CPU and NODE_MEM<commit_after>Virtual Environment
===================

RDO-Manager can be used in a virtual environment using virtual machines instead
of actual baremetal. However, one baremetal machine is still
needed to act as the host for the virtual machines.


Minimum System Requirements
---------------------------
By default, this setup creates 3 virtual machines:

* 1 Undercloud
* 1 Overcloud Controller
* 1 Overcloud Compute

Each virtual machine must consist of at least 4 GB of memory and 40 GB of disk
space [#]_.

.. note::
   The virtual machine disk files are thinly provisioned and will not take up
   the full 40GB initially.

The baremetal machine must meet the following minimum system requirements:

* Virtualization hardware extenstions enabled (nested KVM is **not** supported)
* 1 quad core CPU
* 12 GB free memory
* 120 GB disk space

..
    <REMOVE WHEN HA IS AVAILABLE>

    For minimal **HA (high availability)** deployment you need at least 3 Overcloud
    Controllers and 2 Overcloud Computes which increases the minimum system
    requirements up to:

    * 24 GB free memory
    * 240 GB disk space.

RDO-Manager is supporting only the following operating systems:

* RHEL 7.1 x86_64 or
* CentOS 7 x86_64


.. _preparing_virtual_environment:

Preparing the Virtual Environment (Automated)
---------------------------------------------

#. Install RHEL 7.1 Server x86_64 or CentOS 7 x86_64 on your host machine.

   .. only:: external

      .. admonition:: RHEL Portal Registration
         :class: portal

         Register the host machine using Subscription Management.::

             sudo subscription-manager register --username="[your username]" --password="[<PASSWORD>]"
             # Find this with `subscription-manager list --available`
             sudo subscription-manager attach --pool="[pool id]"
             # Verify repositories are available
             sudo subscription-manager repos --list
             # Enable repositories needed
             sudo subscription-manager repos --enable=rhel-7-server-rpms \
                  --enable=rhel-7-server-optional-rpms --enable=rhel-7-server-extras-rpms \
                  --enable=rhel-7-server-openstack-6.0-rpms

      .. admonition:: RHEL Satellite Registration
         :class: satellite

         To register the host machine to a Satellite, the following repos must
         be synchronized on the Satellite::

             rhel-7-server-rpms
             rhel-7-server-optional-rpms
             rhel-7-server-extras-rpms
             rhel-7-server-openstack-6.0-rpms


         See the `Red Hat Satellite User Guide`_ for how to configure the system to
         register with a Satellite server. It is suggested to use an activation
         key that automatically enables the above repos for registered systems.


#. Make sure sshd service is installed and running.


#. The user performing all of the installation steps on the virt host needs to
   have sudo enabled. You can use an existing user or use the following commands
   to create a new user called stack with password-less sudo enabled. Do not run
   the rest of the steps in this guide as root.

   * Example commands to create a user::

       sudo useradd stack
       sudo passwd stack  # specify a password
       echo "stack ALL=(root) NOPASSWD:ALL" | sudo tee -a /etc/sudoers.d/stack
       sudo chmod 0440 /etc/sudoers.d/stack


#. Make sure you are logged in as the non-root user you intend to use.

   * Example commands to log in as the non-root user::

       su - stack


#. Enable needed repositories:

   .. only:: internal

      .. admonition:: RHEL
         :class: rhel

          Enable rhos-release::

              sudo rpm -ivh http://rhos-release.virt.bos.redhat.com/repos/rhos-release/rhos-release-latest.noarch.rpm

              # Enable either poodles or puddles:
              # To enable poodles:
              sudo rhos-release 7-director -d
              # To enable puddles:
              sudo rhos-release 7-director

              # We need openwsman-python from the optional repo
              sudo yum install -y yum-utils
              sudo yum-config-manager --enable rhelosp-rhel-7-server-opt

   .. note::
     If testing RDO as opposed to RHOS, you need to enable some extra
     repositories:

     ::

         # Enable RDO Kilo
         sudo yum install -y https://rdoproject.org/repos/openstack-kilo/rdo-release-kilo.rpm

         # Enable RDO-Manager Trunk
         sudo curl -o /etc/yum.repos.d/rdo-management-trunk.repo http://trunk-mgt.rdoproject.org/centos-kilo/current-passed-ci/delorean-rdo-management.repo

     The above RDO-Manager Trunk repo is updated after a successful CI run. The following repo can be used instead if the newest packages are needed before a CI run has passed.

     ::

       sudo curl -o /etc/yum.repos.d/rdo-management-trunk.repo http://trunk-mgt.rdoproject.org/centos-kilo/current/delorean-rdo-management.repo


#. Install instack-undercloud::

    sudo yum install -y instack-undercloud

#. The virt setup automatically sets up a vm for the Undercloud installed with
   the same base OS as the host. See the Note below to choose a different
   OS.:

   .. note::
      To setup the undercloud vm with a base OS different from the host,
      set the ``$NODE_DIST`` environment variable prior to running
      ``instack-virt-setup``:

      .. admonition:: CentOS
         :class: centos

         ::

             export NODE_DIST=centos7

      .. admonition:: RHEL
         :class: rhel

         ::

             export NODE_DIST=rhel7


#. Run the script to setup your virtual environment:

   .. note::

      By default, VMs will be created with 1 vCPU and 4096 MiB RAM. To adjust
      those values::

           export NODE_CPU=4
           export NODE_MEM=16384

   .. only:: internal

      .. admonition:: RHEL
         :class: rhel

         Download the RHEL 7.1 cloud image or copy it over from a different
         location, and define the needed environment variables for RHEL 7.1 prior
         to running ``instack-virt-setup``::

             IMAGE=http://download.devel.redhat.com/brewroot/packages/rhel-guest-image/7.1/20150224.0/images/rhel-guest-image-7.1-20150224.0.x86_64.qcow2
             curl -O $IMAGE
             export DIB_LOCAL_IMAGE=`basename $IMAGE`
             export DIB_YUM_REPO_CONF="/etc/yum.repos.d/rhos-release-7-director-rhel-7.1.repo /etc/yum.repos.d/rhos-release-7-rhel-7.1.repo"


   .. only:: external

      .. admonition:: RHEL
         :class: rhel

         Download the RHEL 7.1 cloud image or copy it over from a different
         location, for example: https://access.redhat.com/downloads/content/69/ver=/rhel---7/7.1/x86_64/product-downloads,
         and define the needed environment variables for RHEL 7.1 prior to
         running ``instack-virt-setup``::
{'fraction_non_alphanumeric': 0.08926204153778171, 'fraction_numerical': 0.017749300338783327, 'mean_word_length': 2.3006806028196403, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6796846', 'n_tokens_mistral': 4131, 'n_tokens_neox': 3681, 'n_words': 1404}