docs: Add SSH guide

This is really easy win for people using DevStack for the first time.

Change-Id: I8de2d4d115d34e9d87dd461016b5b894d3f000e7
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This commit is contained in:
Stephen Finucane 2024-08-22 16:24:21 +01:00
parent 6512f0140c
commit 3362be9eda
2 changed files with 41 additions and 1 deletions

View File

@ -133,6 +133,8 @@ there.
You can ``source openrc`` in your shell, and then use the You can ``source openrc`` in your shell, and then use the
``openstack`` command line tool to manage your devstack. ``openstack`` command line tool to manage your devstack.
You can :ref:`create a VM and SSH into it <ssh>`.
You can ``cd /opt/stack/tempest`` and run tempest tests that have You can ``cd /opt/stack/tempest`` and run tempest tests that have
been configured to work with your devstack. been configured to work with your devstack.

View File

@ -68,7 +68,7 @@ Shared Guest Interface
.. warning:: .. warning::
This is not a recommended configuration. Because of interactions This is not a recommended configuration. Because of interactions
between ovs and bridging, if you reboot your box with active between OVS and bridging, if you reboot your box with active
networking you may lose network connectivity to your system. networking you may lose network connectivity to your system.
If you need your guests accessible on the network, but only have 1 If you need your guests accessible on the network, but only have 1
@ -114,3 +114,41 @@ For IPv6, ``FIXED_RANGE_V6`` will default to the first /64 of the value of
``FIXED_RANGE_V6`` will just use the value of that directly. ``FIXED_RANGE_V6`` will just use the value of that directly.
``SUBNETPOOL_PREFIX_V6`` will just default to the value of ``SUBNETPOOL_PREFIX_V6`` will just default to the value of
``IPV6_ADDRS_SAFE_TO_USE`` directly. ``IPV6_ADDRS_SAFE_TO_USE`` directly.
.. _ssh:
SSH access to instances
=======================
To validate connectivity, you can create an instance using the
``$PRIVATE_NETWORK_NAME`` network (default: ``private``), create a floating IP
using the ``$PUBLIC_NETWORK_NAME`` network (default: ``public``), and attach
this floating IP to the instance:
.. code-block:: shell
openstack keypair create --public-key ~/.ssh/id_rsa.pub test-keypair
openstack server create --network private --key-name test-keypair ... test-server
fip_id=$(openstack floating ip create public -f value -c id)
openstack server add floating ip test-server ${fip_id}
Once done, ensure you have enabled SSH and ICMP (ping) access for the security
group used for the instance. You can either create a custom security group and
specify it when creating the instance or add it after creation, or you can
modify the ``default`` security group created by default for each project.
Let's do the latter:
.. code-block:: shell
openstack security group rule create --proto icmp --dst-port 0 default
openstack security group rule create --proto tcp --dst-port 22 default
Finally, SSH into the instance. If you used the Cirros instance uploaded by
default, then you can run the following:
.. code-block:: shell
openstack server ssh test-server -- -l cirros
This will connect using the ``cirros`` user and the keypair you configured when
creating the instance.