Scaling your environment

Scaling your environment

This is a draft environment scaling page for the proposed OpenStack-Ansible operations guide.

Add a new infrastructure host

While three infrastructure hosts are recommended, if further hosts are needed in an environment, it is possible to create additional nodes.

Warning

Make sure you back up your current OpenStack environment before adding any new nodes. See backing-up for more information.

  1. Add the node to the infra_hosts stanza of the /etc/openstack_deploy/openstack_user_config.yml

    infra_hosts:
    [...]
    NEW_infra<node-ID>:
      ip: 10.17.136.32
    NEW_infra<node-ID>:
      ip: 10.17.136.33
    
  2. Change to playbook folder on the deployment host.

    # cd /opt/openstack-ansible/playbooks
    
  3. Update the inventory to add new hosts. Make sure new rsyslog container names are updated. Send the updated results to dev/null.

    # /opt/openstack-ansible/playbooks/inventory/dynamic_inventory.py > /dev/null
    
  4. Create the /root/add_host.limit file, which contains all new node host names. Replace <NEW INFRA NODE> with the name of the new host.

    # /opt/openstack-ansible/scripts/inventory-manage.py  \
      -l |awk '/<NEW INFRA NODE>/ {print $2}' |sort -u | tee /root/add_host.limit
    
  5. Run the setup-everything.yml playbook with the limit argument.

    Warning

    Do not run the setup-everything.yml playbook without the --limit argument. Without --limit, the playbook will restart all containers inside your environment.

    # openstack-ansible setup-everything.yml --limit @/root/add_host.limit
    # openstack-ansible --tags=openstack-host-hostfile setup-hosts.yml
    

Test new infra nodes

After creating a new infra node, test that the node runs correctly by launching a new instance. Ensure that the new node can respond to a networking connection test through the ping command. Log in to your monitoring system, and verify that the monitors return a green signal for the new node.

Add a compute host

Use the following procedure to add a compute host to an operational cluster.

  1. Configure the host as a target host. See Prepare target hosts for more information.

  2. Edit the /etc/openstack_deploy/openstack_user_config.yml file and add the host to the compute_hosts stanza.

    If necessary, also modify the used_ips stanza.

  3. If the cluster is utilizing Telemetry/Metering (ceilometer), edit the /etc/openstack_deploy/conf.d/ceilometer.yml file and add the host to the metering-compute_hosts stanza.

  4. Run the following commands to add the host. Replace NEW_HOST_NAME with the name of the new host.

    # cd /opt/openstack-ansible/playbooks
    # openstack-ansible setup-hosts.yml --limit NEW_HOST_NAME
    # openstack-ansible setup-openstack.yml --skip-tags nova-key-distribute --limit NEW_HOST_NAME
    # openstack-ansible setup-openstack.yml --tags nova-key --limit compute_hosts
    

Test new compute nodes

After creating a new node, test that the node runs correctly by launching an instance on the new node.

$ openstack server create --image IMAGE --flavor m1.tiny \
--key-name KEY --availability-zone ZONE:HOST:NODE \
--nic net-id=UUID SERVER

Ensure that the new instance can respond to a networking connection test through the ping command. Log in to your monitoring system, and verify that the monitors return a green signal for the new node.

Remove a compute host

The openstack-ansible-ops repository contains a playbook for removing a compute host from an OpenStack-Ansible environment. To remove a compute host, follow the below procedure.

Note

This guide describes how to remove a compute node from an OpenStack-Ansible environment completely. Perform these steps with caution, as the compute node will no longer be in service after the steps have been completed. This guide assumes that all data and instances have been properly migrated.

  1. Disable all OpenStack services running on the compute node. This can include, but is not limited to, the nova-compute service and the neutron agent service.

    Note

    Ensure this step is performed first

    # Run these commands on the compute node to be removed
    # stop nova-compute
    # stop neutron-linuxbridge-agent
    
  2. Clone the openstack-ansible-ops repository to your deployment host:

    $ git clone https://git.openstack.org/openstack/openstack-ansible-ops \
      /opt/openstack-ansible-ops
    
  3. Run the remove_compute_node.yml Ansible playbook with the node_to_be_removed user variable set:

    $ cd /opt/openstack-ansible-ops/ansible_tools/playbooks
    openstack-ansible remove_compute_node.yml \
    -e node_to_be_removed="<name-of-compute-host>"
    
  4. After the playbook completes, remove the compute node from the OpenStack-Ansible configuration file in /etc/openstack_deploy/openstack_user_config.yml.

Recover a compute host failure

The following procedure addresses Compute node failure if shared storage is used.

Note

If shared storage is not used, data can be copied from the /var/lib/nova/instances directory on the failed Compute node ${FAILED_NODE} to another node ${RECEIVING_NODE}before performing the following procedure. Please note this method is not supported.

  1. Re-launch all instances on the failed node.

  2. Invoke the MySQL command line tool

  3. Generate a list of instance UUIDs hosted on the failed node:

    mysql> select uuid from instances where host = '${FAILED_NODE}' and deleted = 0;
    
  4. Set instances on the failed node to be hosted on a different node:

    mysql> update instances set host ='${RECEIVING_NODE}' where host = '${FAILED_NODE}' \
    and deleted = 0;
    
  5. Reboot each instance on the failed node listed in the previous query to regenerate the XML files:

    # nova reboot —hard $INSTANCE_UUID
    
  6. Find the volumes to check the instance has successfully booted and is at the login :

    mysql> select nova.instances.uuid as instance_uuid, cinder.volumes.id \
    as voume_uuid, cinder.volumes.status, cinder.volumes.attach_status, \
    cinder.volumes.mountpoint, cinder.volumes,display_name from \
    cinder.volumes inner join nova.instances on cinder.volumes.instance_uuid=nova.instances.uuid \
    where nova.instances.host = '${FAILED_NODE}';
    
  7. If rows are found, detach and re-attach the volumes using the values listed in the previous query:

    # nova volume-detach $INSTANCE_UUID $VOLUME_UUID && \
    # nova volume-attach $INSTANCE_UUID $VOLUME_UUID $VOLUME_MOUNTPOINT
    
  8. Rebuild or replace the failed node as described in add-compute-host.

Replacing failed hardware

It is essential to plan and know how to replace failed hardware in your cluster without compromising your cloud environment.

Consider the following to help establish a hardware replacement plan:

  • What type of node am I replacing hardware on?
  • Can the hardware replacement be done without the host going down? For example, a single disk in a RAID-10.
  • If the host DOES have to be brought down for the hardware replacement, how should the resources on that host be handled?

If you have a Compute (nova) host that has a disk failure on a RAID-10, you can swap the failed disk without powering the host down. On the other hand, if the RAM has failed, you would have to power the host down. Having a plan in place for how you will manage these types of events is a vital part of maintaining your OpenStack environment.

For a Compute host, shut down the instance on the host before it goes down. For a Block Storage (cinder) host using non-redundant storage, shut down any instances with volumes attached that require that mount point. Unmount the drive within your operating system and re-mount the drive once the Block Storage host is back online.

Shutting down the Compute host

If a Compute host needs to be shut down:

  1. Disable the nova-compute binary:

    # nova service-disable --reason "Hardware replacement" HOSTNAME nova-compute
    
  2. List all running instances on the Compute host:

    # nova list --all-t --host <compute_name> | awk '/ACTIVE/ {print $2}' > \
    /home/user/running_instances && for i in `cat /home/user/running_instances`; do nova stop $i ; done
    
  3. Use SSH to connect to the Compute host.

  4. Confirm all instances are down:

    # virsh list --all
    
  5. Shut down the Compute host:

    # shutdown -h now
    
  6. Once the Compute host comes back online, confirm everything is in working order and start the instances on the host. For example:

    # cat /home/user/running_instances
    # do nova start $instance
      done
    
  7. Enable the nova-compute service in the environment:

    # nova service-enable HOSTNAME nova-compute
    

Shutting down the Block Storage host

If a LVM backed Block Storage host needs to be shut down:

  1. Disable the cinder-volume service:

    # cinder service-list --host CINDER SERVICE NAME INCLUDING @BACKEND
    # cinder service-disable CINDER SERVICE NAME INCLUDING @BACKEND \
    cinder-volume --reason 'RAM maintenance'
    
  2. List all instances with Block Storage volumes attached:

    # mysql cinder -BNe 'select instance_uuid from volumes where deleted=0 \
    and host like "%<cinder host>%"' | tee /home/user/running_instances
    
  3. Shut down the instances:

    # cat /home/user/running_instances | xargs -n1 nova stop
    
  4. Verify the instances are shutdown:

    # cat /home/user/running_instances | xargs -n1 nova show | fgrep vm_state
    
  5. Shut down the Block Storage host:

    # shutdown -h now
    
  6. Replace the failed hardware and validate the new hardware is functioning.

  7. Enable the cinder-volume service:

    # cinder service-enable CINDER SERVICE NAME INCLUDING @BACKEND cinder-volume
    
  8. Verify the services on the host are reconnected to the environment:

    # cinder service-list --host CINDER SERVICE NAME INCLUDING @BACKEND
    
  9. Start your instances and confirm all of the instances are started:

    # cat /home/user/running_instances | xargs -n1 nova start
    # cat /home/user/running_instances | xargs -n1 nova show | fgrep vm_state
    
Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.