iaas (openstack) super detailed stack building operation

Keywords: yum OpenStack CentOS network

This blog will introduce the UI operation of the stack in openstack
First, put the required files on the http service

[root@controller xiandian]# pwd
/etc/xiandian
[root@controller xiandian]# ls
lb-server.yaml  nginx_flat.yaml  nginx.yaml  openrc.sh
[root@controller xiandian]# cp nginx* /var/www/html/
[root@controller xiandian]# cp lb-server.yaml /var/www/html/
[root@controller xiandian]# 


The following answers to the above five options one by one

1. The password of admin is 000000, which is the password of openstack
2. The URL of yum is actually the http service address that we initially set up in the controller node. As an httpd server. You can view it in our yum source

The yum source of centos is required here

[root@compute ~]# vi /etc/yum.repos.d/local.repo 
[centos]
name=centos
baseurl=ftp://192.168.1.11/centos
gpgcheck=0
enabled=1
[iaas]
name=iaas
baseurl=ftp://192.168.1.11/iaas/iaas-repo
gpgcheck=0
enabled=1
~
3. We can use openstack or glance basic command to view image name

Here is the basic command of glance

[root@controller html]# glance image-list
+--------------------------------------+-----------+
| ID                                   | Name      |
+--------------------------------------+-----------+
| 35f04fd3-694b-4ac3-9417-f2a61e479ec6 | CentOS7.0 |
| 37fd20a5-9924-417d-9f51-d283251fafca | centos8   |
| 417f7098-6ac9-4d4f-94e7-23e0616d0f7c | mysql-5.6 |
+--------------------------------------+-----------+
4. For our network name, we can use openstack or the basic command of its component nautron to view it

Let's use the command of openstack to check

[root@controller html]# openstack network list
+--------------------------------------+---------+--------------------------------------+
| ID                                   | Name    | Subnets                              |
+--------------------------------------+---------+--------------------------------------+
| 9ccc01f7-9529-400e-a192-e299baf5ba9c | ext_net | 20eb1afc-fa08-4e91-887a-908375794ef7 |
| c2fc035e-bf7e-412c-81c7-4b904fea870b | ins_net | 01655c52-a687-4d29-81df-15b15fa70d88 |
+--------------------------------------+---------+--------------------------------------+
[root@controller html]# 
5. Here is the ID of our load balancing lbaas

We can check it through the basic command of openstack

[root@controller html]# neutron lb-pool-list
+--------------------------------------+---------------+----------+-------------+----------+----------------+--------+
| id                                   | name          | provider | lb_method   | protocol | admin_state_up | status |
+--------------------------------------+---------------+----------+-------------+----------+----------------+--------+
| a84b45ce-7fcf-4543-b207-2e489fa0722b | resource_pool | haproxy  | ROUND_ROBIN | HTTP     | True           | ACTIVE |
+--------------------------------------+---------------+----------+-------------+----------+----------------+--------+

After filling in, click create, as shown in the following figure


This is the stack template

description: A load-balancer server
heat_template_version: '2014-10-16'
parameters:
  flavor: {default: m1.small, type: string}
  ftp_yum_url: {description: Yum Url, type: string}
  image: {default: centos7, description: Images, type: string}
  network_name: {default: int-net1, description: Int Network, type: string}
  pool_id: {description: LBaas Pool to join, type: string}
  server_name: {default: web_server, description: Server Name, type: string}
resources:
  member:
    properties:
      address:
        get_attr: [server, first_address]
      pool_id: {get_param: pool_id}
      protocol_port: 80
    type: OS::Neutron::PoolMember
  server:
    properties:
      flavor: {get_param: flavor}
      image: {get_param: image}
      name: {get_param: server_name}
      networks:
      - network: {get_param: network_name}
      user_data:
        str_replace:
          params:
            ftp_yum_url: {get_param: ftp_yum_url}
          template: '#!/bin/bash

            mkdir -p /opt/repo

            mv /etc/yum.repos.d/* /opt/repo

            cat > /etc/yum.repos.d/yum.repo <<-EOF

            [centos7]

            name=centos7

            gpgcheck=0

            baseurl=ftp_yum_url

            enabled=1

            EOF


            setenforce 0

            yum clean all


            yum install httpd -y

            systemctl restart httpd

            systemctl enable httpd

            '
      user_data_format: RAW
    type: OS::Nova::Server

Posted by danboy712 on Mon, 11 Nov 2019 08:31:54 -0800