이 콘텐츠는 선택한 언어로 제공되지 않습니다.

Chapter 9. Examples


Use the following examples to understand how to launch a compute instance post-deployment with various network configurations.

9.1. Example 1: Launching a Compute node with one NIC on the tenant and provider networks

Use this example to understand how to launch a Compute node with the private tenant network and the provider network after you deploy the all-in-one Red Hat OpenStack Platform environment. This example is based on a single NIC configuration and requires at least three IP addresses.

Prerequisites

To complete this example successfully, you must have the following IP addresses available in your environment:

  • One IP address for the OpenStack services.
  • One IP address for the virtual router to provide connectivity to the tenant network. This IP address is assigned automatically in this example.
  • At least one IP address for floating IPs on the provider network.

Procedure

  1. Create configuration helper variables:

    # standalone with tenant networking and provider networking
    export OS_CLOUD=standalone
    export GATEWAY=192.168.24.1
    export STANDALONE_HOST=192.168.24.2
    export PUBLIC_NETWORK_CIDR=192.168.24.0/24
    export PRIVATE_NETWORK_CIDR=192.168.100.0/24
    export PUBLIC_NET_START=192.168.24.4
    export PUBLIC_NET_END=192.168.24.5
    export DNS_SERVER=1.1.1.1
  2. Create a basic flavor:

    $ openstack flavor create --ram 512 --disk 1 --vcpu 1 --public tiny
  3. Download CirrOS and create an OpenStack image:

    $ wget https://download.cirros-cloud.net/0.4.0/cirros-0.4.0-x86_64-disk.img
    $ openstack image create cirros --container-format bare --disk-format qcow2 --public --file cirros-0.4.0-x86_64-disk.img
  4. Configure SSH:

    $ ssh-keygen
    $ openstack keypair create --public-key ~/.ssh/id_rsa.pub default
  5. Create a simple network security group:

    $ openstack security group create basic
  6. Configure the new network security group:

    1. Enable SSH:

      $ openstack security group rule create basic --protocol tcp --dst-port 22:22 --remote-ip 0.0.0.0/0
    2. Enable ping:

      $ openstack security group rule create --protocol icmp basic
    3. Enable DNS:

      $ openstack security group rule create --protocol udp --dst-port 53:53 basic
  7. Create Neutron networks:

    $ openstack network create --external --provider-physical-network datacentre --provider-network-type flat public
    $ openstack network create --internal private
    $ openstack subnet create public-net \
        --subnet-range $PUBLIC_NETWORK_CIDR \
        --no-dhcp \
        --gateway $GATEWAY \
        --allocation-pool start=$PUBLIC_NET_START,end=$PUBLIC_NET_END \
        --network public
    $ openstack subnet create private-net \
        --subnet-range $PRIVATE_NETWORK_CIDR \
        --network private
  8. Create a virtual router:

    # NOTE: In this case an IP will be automatically assigned
    # from the allocation pool for the subnet.
    $ openstack router create vrouter
    $ openstack router set vrouter --external-gateway public
    $ openstack router add subnet vrouter private-net
  9. Create a floating IP:

    $ openstack floating ip create public
  10. Launch the instance:

    $ openstack server create --flavor tiny --image cirros --key-name default --network private --security-group basic myserver
  11. Assign the floating IP:

    $ openstack server add floating ip myserver <FLOATING_IP>

    Replace FLOATING_IP with the address of the floating IP that you create in a previous step.

  12. Test SSH:

    ssh cirros@<FLOATING_IP>

    Replace FLOATING_IP with the address of the floating IP that you create in a previous step.

Network Architecture

Standalone1NIC Tenant Provider

9.2. Example 2: Launching a Compute node with one NIC on the provider network

Use this example to understand how to launch a Compute node with the provider network after you deploy the all-in-one Red Hat OpenStack Platform environment. This example is based on a single NIC configuration and requires at least four IP addresses.

Prerequisites

To complete this example successfully, you must have the following IP addresses available in your environment:

  • One IP address for the OpenStack services.
  • One IP address for the virtual router to provide connectivity to the tenant network. This IP address is assigned automatically in this example.
  • One IP address for DHCP on the provider network.
  • At least one IP address for floating IPs on the provider network.

Procedure

  1. Create configuration helper variables:

    # standalone with tenant networking and provider networking
    export OS_CLOUD=standalone
    export GATEWAY=192.168.24.1
    export STANDALONE_HOST=192.168.24.2
    export VROUTER_IP=192.168.24.3
    export PUBLIC_NETWORK_CIDR=192.168.24.0/24
    export PUBLIC_NET_START=192.168.24.4
    export PUBLIC_NET_END=192.168.24.5
    export DNS_SERVER=1.1.1.1
  2. Create a basic flavor:

    $ openstack flavor create --ram 512 --disk 1 --vcpu 1 --public tiny
  3. Download CirrOS and create an OpenStack image:

    $ wget https://download.cirros-cloud.net/0.4.0/cirros-0.4.0-x86_64-disk.img
    $ openstack image create cirros --container-format bare --disk-format qcow2 --public --file cirros-0.4.0-x86_64-disk.img
  4. Configure SSH:

    $ ssh-keygen
    $ openstack keypair create --public-key ~/.ssh/id_rsa.pub default
  5. Create a simple network security group:

    $ openstack security group create basic
  6. Configure the new network security group:

    1. Enable SSH:

      $ openstack security group rule create basic --protocol tcp --dst-port 22:22 --remote-ip 0.0.0.0/0
    2. Enable ping:

      $ openstack security group rule create --protocol icmp basic
    3. Enable DNS:

      $ openstack security group rule create --protocol udp --dst-port 53:53 basic
  7. Create Neutron networks:

    $ openstack network create --external --provider-physical-network datacentre --provider-network-type flat public
    $ openstack network create --internal private
    $ openstack subnet create public-net \
        --subnet-range $PUBLIC_NETWORK_CIDR \
        --gateway $GATEWAY \
        --allocation-pool start=$PUBLIC_NET_START,end=$PUBLIC_NET_END \
        --network public \
        --host-route destination=169.254.169.254/32,gateway=$VROUTER_IP \
        --host-route destination=0.0.0.0/0,gateway=$GATEWAY \
        --dns-nameserver $DNS_SERVER
  8. Create a virtual router:

    # NOTE: In this case an IP will be automatically assigned
    # from the allocation pool for the subnet.
    $ openstack router create vrouter
    $ openstack port create --network public --fixed-ip subnet=public-net,ip-address=$VROUTER_IP vrouter-port
    $ openstack router add port vrouter vrouter-port
  9. Launch the instance:

    $ openstack server create --flavor tiny --image cirros --key-name default --network public --security-group basic myserver
  10. Test SSH:

    ssh cirros@<VM_IP>

    Replace VM_IP with the address of the virtual machine that you create in the previous step.

Network Architecture

Standalone1NIC Provider

9.3. Example 3: Launching a Compute node with two NICs on the tenant and provider networks

Use this example to understand how to launch a Compute node with the private tenant network and the provider network after you deploy the all-in-one Red Hat OpenStack Platform environment. This example is based on a dual NIC configuration and requires at least three IP addresses on the provider network.

Prerequisites

  • One IP address for a gateway on the provider network.
  • One IP address for OpenStack endpoints.
  • One IP address for the virtual router to provide connectivity to the tenant network. This IP address is assigned automatically in this example.
  • At least one IP address for floating IPs on the provider network.

Procedure

  1. Create configuration helper variables:

    # standalone with tenant networking and provider networking
    export OS_CLOUD=standalone
    export GATEWAY=192.168.24.1
    export STANDALONE_HOST=192.168.0.2
    export PUBLIC_NETWORK_CIDR=192.168.24.0/24
    export PRIVATE_NETWORK_CIDR=192.168.100.0/24
    export PUBLIC_NET_START=192.168.0.3
    export PUBLIC_NET_END=192.168.24.254
    export DNS_SERVER=1.1.1.1
  2. Create a basic flavor:

    $ openstack flavor create --ram 512 --disk 1 --vcpu 1 --public tiny
  3. Download CirrOS and create an OpenStack image:

    $ wget https://download.cirros-cloud.net/0.4.0/cirros-0.4.0-x86_64-disk.img
    $ openstack image create cirros --container-format bare --disk-format qcow2 --public --file cirros-0.4.0-x86_64-disk.img
  4. Configure SSH:

    $ ssh-keygen
    $ openstack keypair create --public-key ~/.ssh/id_rsa.pub default
  5. Create a simple network security group:

    $ openstack security group create basic
  6. Configure the new network security group:

    1. Enable SSH:

      $ openstack security group rule create basic --protocol tcp --dst-port 22:22 --remote-ip 0.0.0.0/0
    2. Enable ping:

      $ openstack security group rule create --protocol icmp basic
    3. Enable DNS:

      $ openstack security group rule create --protocol udp --dst-port 53:53 basic
  7. Create Neutron networks:

    $ openstack network create --external --provider-physical-network datacentre --provider-network-type flat public
    $ openstack network create --internal private
    $ openstack subnet create public-net \
        --subnet-range $PUBLIC_NETWORK_CIDR \
        --no-dhcp \
        --gateway $GATEWAY \
        --allocation-pool start=$PUBLIC_NET_START,end=$PUBLIC_NET_END \
        --network public
    $ openstack subnet create private-net \
        --subnet-range $PRIVATE_NETWORK_CIDR \
        --network private
  8. Create a virtual router:

    # NOTE: In this case an IP will be automatically assigned
    # from the allocation pool for the subnet.
    $ openstack router create vrouter
    $ openstack router set vrouter --external-gateway public
    $ openstack router add subnet vrouter private-net
  9. Create a floating IP:

    $ openstack floating ip create public
  10. Launch the instance:

    $ openstack server create --flavor tiny --image cirros --key-name default --network private --security-group basic myserver
  11. Assign the floating IP:

    $ openstack server add floating ip myserver <FLOATING_IP>

    Replace FLOATING_IP with the address of the floating IP that you create in a previous step.

  12. Test SSH:

    ssh cirros@<FLOATING_IP>

    Replace FLOATING_IP with the address of the floating IP that you create in a previous step.

Network Architecture

Standalone2NIC Tenant Provider

Red Hat logoGithubRedditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

© 2024 Red Hat, Inc.