From 5813c49d8983763f8bd7c455b2f1600b838312d8 Mon Sep 17 00:00:00 2001 From: Pasha Date: Mon, 5 Jun 2023 19:01:38 +0000 Subject: update for installing on physical hardware --- README | 60 +++++++++++++++++++----------- configs/ml2_conf.ini | 2 +- next_steps | 102 +++++++++++++++++++++++++++++++++++---------------- openstack_setup.sh | 2 +- 4 files changed, 110 insertions(+), 56 deletions(-) diff --git a/README b/README index ac69110..900b476 100644 --- a/README +++ b/README @@ -14,37 +14,38 @@ along with this program. If not, see . -Debian OpenStack Installer --------------------------- -requirements +Debian OpenStack Installer for home lab +--------------------------------------- -1. Install or update to Debian 12 (Bookworm) +1. Install Debian 12 (Bookworm) on a physical machine. -2. current configuration uses agent networking (bridge). - -Therefore, you need two network interfaces with two different network series. - -If you are using VM, then you may configure enp1s0 as "bridge network" with your main network. -and enp7s0 as NAT interface. Add two interfaces in your virtual machine. +We will use same network interface for host and virtual machines. +/etc/network/interfaces +------------------------------- +... +allow-hotplug eno1 +iface eno1 inet static + address 192.168.0.155 + broadcast 192.168.0.255 + netmask 255.255.255.0 + gateway 192.168.0.1 + dns-nameservers 192.168.0.1 +-------------------------------- external router | | - br0 virbr0 - | | - | | (example qemu has two interfaces) - -------|------> enp1s0 - static IP: 192.168.0.155 - | - | - -------> enp7s0 - static IP/DHCP: 192.168.122.10 + eno1 + | + -------> static IP: 192.168.0.155 -3. edit openstack_setup.sh and set the following setting: +2. edit "openstack_setup.sh" and set the following setting: OPENSTACK_HOST_IP="192.168.0.155" -EXTERNAL_BRIDGE_INTERFACE="enp7s0" +EXTERNAL_BRIDGE_INTERFACE="eno1" # chmod +x openstack_setup.sh # ./openstack_setup.sh &> output.txt @@ -52,9 +53,24 @@ EXTERNAL_BRIDGE_INTERFACE="enp7s0" check output from another shell # tail -f output.txt - restart and start exploring openstack on Debian. -You may check "next_step" file. -https://192.168.0.155/horizon/ +3. Check "next_steps" for networking and launching your first instance. + + +4. You can access dashboard: https://192.168.0.155/horizon/ + + +after you launch your first instance + +external +router + | + | + eno1 + | + -------> bridge-xxx - static IP: 192.168.0.155 + | + | + ------- virtual machines ... diff --git a/configs/ml2_conf.ini b/configs/ml2_conf.ini index e7955b6..7e1bfc9 100644 --- a/configs/ml2_conf.ini +++ b/configs/ml2_conf.ini @@ -2,7 +2,7 @@ #debug = true [ml2] -type_drivers = flat,vlan +type_drivers = flat tenant_network_types = mechanism_drivers = linuxbridge extension_drivers = port_security diff --git a/next_steps b/next_steps index afea0a9..0715390 100644 --- a/next_steps +++ b/next_steps @@ -1,36 +1,52 @@ + +Authenticate +$ . debian_openstack_installer/admin-openrc + + +verify all network agents are ready +$ openstack network agent list + + Create provider network: -openstack network create --share --external \ +define network +$ openstack network create --share --external \ --provider-physical-network provider \ --provider-network-type flat provider -openstack subnet create --network provider \ - --allocation-pool start=192.168.122.20,end=192.168.122.200 \ - --dns-nameserver 192.168.122.1 --gateway 192.168.122.1 \ - --subnet-range 192.168.122.0/24 provider - -openstack security group rule create --proto icmp default -openstack security group rule create --proto tcp --dst-port 22 default +define subnet +$ openstack subnet create --network provider \ + --allocation-pool start=192.168.0.20,end=192.168.0.90 \ + --dns-nameserver 192.168.0.1 --gateway 192.168.0.1 \ + --subnet-range 192.168.0.0/24 provider + + +enable icmp and ssh ports +$ openstack security group rule create --proto icmp default +$ openstack security group rule create --proto tcp --dst-port 22 default Generate a key pair: -ssh-keygen -q -N "" +$ ssh-keygen -q -N "" + cd to your home directory -openstack keypair create --public-key ~/.ssh/id_rsa.pub mykey +$ openstack keypair create --public-key ~/.ssh/id_rsa.pub mykey verify -openstack keypair list +$ openstack keypair list -openstack flavor create --id 0 --vcpus 2 --ram 1024 --disk 10 m1.nano +create cpu flavor +$ openstack flavor create --id 0 --vcpus 2 --ram 1024 --disk 10 m1.nano -Download debian openstack image + +download debian openstack image https://cdimage.debian.org/cdimage/openstack/ - -upload it: -openstack image create \ + +upload +$ openstack image create \ --container-format bare \ --disk-format qcow2 \ --property hw_disk_bus=scsi \ @@ -38,13 +54,14 @@ openstack image create \ --property os_type=linux \ --property os_distro=debian \ --property os_admin_user=debian \ - --property os_version='10.12.7' \ + --property os_version='10' \ --public \ - --file debian-10.12.7-20220706-openstack-amd64.qcow2 \ - debian-10.12.7-openstack-amd64 + --file debian-10-openstack-amd64.qcow2 \ + debian-10-openstack-amd64 -openstack network list +check network +$ openstack network list +--------------------------------------+----------+--------------------------------------+ | ID | Name | Subnets | +--------------------------------------+----------+--------------------------------------+ @@ -53,15 +70,15 @@ openstack network list copy ID as net-id while creating server - -openstack server create --flavor m1.nano --image debian-10.12.7-openstack-amd64 \ - --nic net-id=da5f9aa8-1bac-4aab-9931-0ce4d835783a --security-group default \ +$ openstack server create --flavor m1.nano --image debian-10-openstack-amd64 \ + --nic net-id=da5f9aa8-1bac-4aab-9931-0ce4d835783a \ + --security-group default \ --key-name mykey debianinstance -if you get error like "More than one SecurityGroup exists with the name 'default'." -check -openstack security group list +If you get error like "More than one SecurityGroup exists with the name 'default'." + +$ openstack security group list +--------------------------------------+---------+------------------------+----------------------------------+------+ | ID | Name | Description | Project | Tags | +--------------------------------------+---------+------------------------+----------------------------------+------+ @@ -69,15 +86,36 @@ openstack security group list | f9151d2a-f49b-4828-9467-418d7cdfd1e8 | default | Default security group | 87b3104005904a2fbe18ad1a7ab601b3 | [] | +--------------------------------------+---------+------------------------+----------------------------------+------+ -inspect which one you enabled icmp and port 22 -openstack security group show cd54c8c9-d754-434a-9f5c-807c3288fced +inspect which one you enabled icmp and port 22 using the following command + +$ openstack security group show cd54c8c9-d754-434a-9f5c-807c3288fced -specify security group id instead of name +delete the other one +$ openstack security group delete ID -openstack server create --flavor m1.nano --image debian-10.12.7-openstack-amd64 \ - --nic net-id=b2d69a6e-3a77-4d55-94fd-308558088a3d --security-group cd54c8c9-d754-434a-9f5c-807c3288fced \ +you may also specify security group id instead of name +$ openstack server create --flavor m1.nano --image debian-10-openstack-amd64 \ + --nic net-id=b2d69a6e-3a77-4d55-94fd-308558088a3d \ + --security-group cd54c8c9-d754-434a-9f5c-807c3288fced \ --key-name mykey debianinstance +You may need to delete other default security group. +note: openstack server list may fail if multiple default profiles are present. verify -openstack server list +$ openstack server list + + +when virtual server is ready you may ssh +$ ssh debian@IP + +You may install apache2 for testing in vm. + +You need to enable port 80 for security group to allow accessing from other hosts. +example: +$ openstack security group rule create --proto tcp --dst-port 80 default + +(better create a new security group instead of enabling port 80 for default profile) + + +dashboard: https://192.168.0.155/horizon/ diff --git a/openstack_setup.sh b/openstack_setup.sh index df46714..9339672 100644 --- a/openstack_setup.sh +++ b/openstack_setup.sh @@ -17,7 +17,7 @@ OPENSTACK_HOST_IP="192.168.0.155" -EXTERNAL_BRIDGE_INTERFACE="enp7s0" +EXTERNAL_BRIDGE_INTERFACE="eno1" MY_USER_NAME="openstack" MY_USER_PASS="openstack" -- cgit v1.2.1