• openstack在计算节点安装配置 Nova


    在计算节点执行以下操作
    1 、安装组件

    yum -y install openstack-nova-compute

    [root@compute01 ~]#  yum -y install openstack-nova-compute
    Loaded plugins: fastestmirror, langpacks
    Repository base is listed more than once in the configuration
    Repository updates is listed more than once in the configuration
    Repository extras is listed more than once in the configuration
    Loading mirror speeds from cached hostfile
     * base: mirrors.ustc.edu.cn
     * extras: mirrors.ustc.edu.cn
     * updates: mirrors.ustc.edu.cn
    base                                                                                                                 | 3.6 kB  00:00:00     
    Not using downloaded base/repomd.xml because it is older than what we have:
      Current   : Tue Nov 22 17:31:15 2022
      Downloaded: Fri Oct 30 04:03:00 2020
    centos-nfs-ganesha28                                                                                                 | 2.9 kB  00:00:00     
    centos-openstack-train                                                                                               | 2.9 kB  00:00:00     
    centos-qemu-ev                                                                                                       | 2.9 kB  00:00:00     
    ceph                                                                                                                 | 2.9 kB  00:00:00     
    ceph-noarch                                                                                                          | 2.9 kB  00:00:00     
    docker-ce-stable                                                                                                     | 2.9 kB  00:00:00     
    epel                                                                                                                 | 2.9 kB  00:00:00     
    extras                                                                                                               | 2.9 kB  00:00:00     
    Not using downloaded extras/repomd.xml because it is older than what we have:
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23

    如果遇到以下报错

    
    ---> Package texlive-kpathsea-bin.x86_64 2:svn27347.0-45.20130427_r30134.el7 will be installed
    ---> Package tix.x86_64 1:8.4.3-12.el7 will be installed
    --> Finished Dependency Resolution
    Error: Package: python2-qpid-proton-0.26.0-2.el7.x86_64 (centos-openstack-train)
               Requires: qpid-proton-c(x86-64) = 0.26.0-2.el7
               Available: qpid-proton-c-0.14.0-2.el7.x86_64 (extras)
                   qpid-proton-c(x86-64) = 0.14.0-2.el7
               Available: qpid-proton-c-0.26.0-2.el7.x86_64 (centos-openstack-train)
                   qpid-proton-c(x86-64) = 0.26.0-2.el7
               Installing: qpid-proton-c-0.37.0-1.el7.x86_64 (epel)
                   qpid-proton-c(x86-64) = 0.37.0-1.el7
     You could try using --skip-broken to work around the problem
     You could try running: rpm -Va --nofiles --nodigest
    [root@compute01 ~]# Error: Package: python2-qpid-proton-0.26.0-2.el7.x86_64 (centos-openstack-train)
    -bash: syntax error near unexpected token `('
    [root@compute01 ~]#            Requires: qpid-proton-c(x86-64) = 0.26.0-2.el7^C
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18

    则解决办法为:

    
    [root@compute01 ~]# yum -y install python2-qpid-proton-0.26.0-2.el7.x86_64
    Loaded plugins: fastestmirror, langpacks
    Repository base is listed more than once in the configuration
    Repository updates is listed more than once in the configuration
    Repository extras is listed more than once in the configuration
    Loading mirror speeds from cached hostfile
     * base: mirrors.ustc.edu.cn
     * extras: mirrors.ustc.edu.cn
     * updates: mirrors.ustc.edu.cn
    Resolving Dependencies
    --> Running transaction check
    ---> Package python2-qpid-proton.x86_64 0:0.26.0-2.el7 will be installed
    --> Processing Dependency: qpid-proton-c(x86-64) = 0.26.0-2.el7 for package: python2-qpid-proton-0.26.0-2.el7.x86_64
    --> Processing Dependency: libqpid-proton.so.11()(64bit) for package: python2-qpid-proton-0.26.0-2.el7.x86_64
    --> Running transaction check
    ---> Package qpid-proton-c.x86_64 0:0.26.0-2.el7 will be installed
    --> Finished Dependency Resolution
    
    Dependencies Resolved
    
    ============================================================================================================================================
     Package                              Arch                    Version                         Repository                               Size
    ============================================================================================================================================
    Installing:
     python2-qpid-proton                  x86_64                  0.26.0-2.el7                    centos-openstack-train                  217 k
    Installing for dependencies:
     qpid-proton-c                        x86_64                  0.26.0-2.el7                    centos-openstack-train                  185 k
    
    Transaction Summary
    ============================================================================================================================================
    Install  1 Package (+1 Dependent package)
    
    Total download size: 402 k
    Installed size: 1.9 M
    Downloading packages:
    (1/2): qpid-proton-c-0.26.0-2.el7.x86_64.rpm                                                                         | 185 kB  00:00:00     
    (2/2): python2-qpid-proton-0.26.0-2.el7.x86_64.rpm                                                                   | 217 kB  00:00:00     
    --------------------------------------------------------------------------------------------------------------------------------------------
    Total                                                                                                       1.1 MB/s | 402 kB  00:00:00     
    Running transaction check
    Running transaction test
    Transaction test succeeded
    Running transaction
      Installing : qpid-proton-c-0.26.0-2.el7.x86_64                                                                                        1/2 
      Installing : python2-qpid-proton-0.26.0-2.el7.x86_64                                                                                  2/2 
      Verifying  : qpid-proton-c-0.26.0-2.el7.x86_64                                                                                        1/2 
      Verifying  : python2-qpid-proton-0.26.0-2.el7.x86_64                                                                                  2/2 
    
    Installed:
      python2-qpid-proton.x86_64 0:0.26.0-2.el7                                                                                                 
    
    Dependency Installed:
      qpid-proton-c.x86_64 0:0.26.0-2.el7                                                                                                       
    
    Complete!
    [root@compute01 ~]#  yum -y install openstack-nova-compute
     python2-oslo-reports.noarch 0:1.30.0-1.el7                              python2-oslo-rootwrap.noarch 0:5.16.1-1.el7                      
      python2-oslo-service.noarch 0:1.40.2-2.el7                              python2-oslo-upgradecheck.noarch 0:0.3.2-1.el7                   
      python2-oslo-versionedobjects.noarch 0:1.36.1-1.el7                     python2-oslo-vmware.noarch 0:2.34.1-1.el7                        
      python2-ovsdbapp.noarch 0:0.17.5-1.el7                                  python2-pandas.x86_64 0:0.19.1-2.el7.2                           
      python2-paramiko.noarch 0:2.4.2-2.el7                                   python2-pillow.x86_64 0:5.4.1-3.el7                              
      python2-psutil.x86_64 0:5.6.7-1.el7                                     python2-pycadf.noarch 0:2.10.0-2.el7                             
      python2-pydot.noarch 0:1.4.1-1.el7                                      python2-pynacl.x86_64 0:1.3.0-1.el7                              
      python2-pyroute2.noarch 0:0.5.6-1.el7                                   python2-redis.noarch 0:3.1.0-1.el7                               
      python2-rsa.noarch 0:3.4.2-3.el7                                        python2-scipy.x86_64 0:0.18.0-3.el7                              
      python2-sqlalchemy.x86_64 0:1.2.17-2.el7                                python2-statsd.noarch 0:3.2.1-5.el7                              
      python2-suds.noarch 0:0.7-0.4.94664ddd46a6.el7                          python2-tables.x86_64 0:3.3.0-4.el7                              
      python2-taskflow.noarch 0:3.7.1-1.el7                                   python2-tenacity.noarch 0:5.1.1-4.el7                            
      python2-tooz.noarch 0:1.66.3-1.el7                                      python2-vine.noarch 0:1.2.0-2.el7                                
      python2-voluptuous.noarch 0:0.11.5-1.el7.1                              python2-webob.noarch 0:1.8.5-1.el7                               
      python2-yappi.x86_64 0:1.0-1.el7                                        python2-zake.noarch 0:0.2.2-2.el7                                
      sysfsutils.x86_64 0:2.1.0-16.el7                                        t1lib.x86_64 0:5.1.2-14.el7                                      
      texlive-base.noarch 2:2012-45.20130427_r30134.el7                       texlive-dvipng.noarch 2:svn26689.1.14-45.el7                     
      texlive-dvipng-bin.x86_64 2:svn26509.0-45.20130427_r30134.el7           texlive-kpathsea.noarch 2:svn28792.0-45.el7                      
      texlive-kpathsea-bin.x86_64 2:svn27347.0-45.20130427_r30134.el7         texlive-kpathsea-lib.x86_64 2:2012-45.20130427_r30134.el7        
      tix.x86_64 1:8.4.3-12.el7                                               tkinter.x86_64 0:2.7.5-92.el7_9                                  
    
    Complete!
    #修改配置文件 /etc/nova/nova.conf
    [root@compute01 nova]#  vi /etc/nova/nova.conf
    [root@compute01 nova]# cat  /etc/nova/nova.conf
    [DEFAULT]
    enabled_apis = osapi_compute,metadata
    transport_url = rabbit://openstack:openstack@controller
    my_ip = 192.168.182.131
    use_neutron = true
    firewall_driver = nova.virt.firewall.NoopFirewallDriver
    
    [api]
    auth_strategy = keystone
    
    [api_database]
    [barbican]
    [cache]
    [cinder]
    [compute]
    [conductor]
    [console]
    [consoleauth]
    [cors]
    [database]
    [devices]
    [ephemeral_storage_encryption]
    [filter_scheduler]
    
    [glance]
    api_servers = http://controller:9292
    
    [guestfs]
    [healthcheck]
    [hyperv]
    [ironic]
    [key_manager]
    [keystone]
    
    [keystone_authtoken]
    auth_url = http://controller:5000/v3
    memcached_servers = controller:11211
    auth_type = password
    project_domain_name = Default
    user_domain_name = Default
    project_name = service
    username = nova
    password = openstack2022
    token_cache_time=3600
    
    [libvirt]
    # virt_type = qemu
    virt_type = kvm
    num_pcie_ports=10
    
    [metrics]
    [mks]
    [neutron]
    url = http://controller:9696
    auth_url = http://controller:5000/v3
    auth_type = password
    project_domain_name = default
    user_domain_name = default
    region_name = RegionOne
    project_name = service
    username = neutron
    password = openstack2022
    
    [notifications]
    [osapi_v21]
    
    [oslo_concurrency]
    lock_path = /var/lib/nova/tmp
    
    [oslo_messaging_amqp]
    [oslo_messaging_kafka]
    [oslo_messaging_notifications]
    [oslo_messaging_rabbit]
    [oslo_middleware]
    [oslo_policy]
    [pci]
    
    [placement]
    region_name = RegionOne
    project_domain_name = Default
    project_name = service
    auth_type = password
    user_domain_name = Default
    auth_url = http://controller:5000/v3
    username = placement
    password = openstack2022
    
    [powervm]
    [privsep]
    [profiler]
    [quota]
    [rdp]
    [remote_debug]
    
    [scheduler]
    discover_hosts_in_cells_interval = 180
    
    [serial_console]
    [service_user]
    [spice]
    [upgrade_levels]
    [vault]
    [vendordata_dynamic_auth]
    [vmware]
    
    [vnc]
    enabled = true
    # 此处监听 ip 不能写当前计算节点 ip ,因为如果要做实例迁移,迁移后实例 vnc 地址会发生变化
    server_listen = 0.0.0.0
    server_proxyclient_address = $my_ip
    novncproxy_base_url = http://controller:6080/vnc_auto.html
    vncserver_proxyclient_address = $my_ip
    
    [workarounds]
    [wsgi]
    [xenserver]
    [xvp]
    [zvm]
    [root@compute01 nova]# 
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75
    • 76
    • 77
    • 78
    • 79
    • 80
    • 81
    • 82
    • 83
    • 84
    • 85
    • 86
    • 87
    • 88
    • 89
    • 90
    • 91
    • 92
    • 93
    • 94
    • 95
    • 96
    • 97
    • 98
    • 99
    • 100
    • 101
    • 102
    • 103
    • 104
    • 105
    • 106
    • 107
    • 108
    • 109
    • 110
    • 111
    • 112
    • 113
    • 114
    • 115
    • 116
    • 117
    • 118
    • 119
    • 120
    • 121
    • 122
    • 123
    • 124
    • 125
    • 126
    • 127
    • 128
    • 129
    • 130
    • 131
    • 132
    • 133
    • 134
    • 135
    • 136
    • 137
    • 138
    • 139
    • 140
    • 141
    • 142
    • 143
    • 144
    • 145
    • 146
    • 147
    • 148
    • 149
    • 150
    • 151
    • 152
    • 153
    • 154
    • 155
    • 156
    • 157
    • 158
    • 159
    • 160
    • 161
    • 162
    • 163
    • 164
    • 165
    • 166
    • 167
    • 168
    • 169
    • 170
    • 171
    • 172
    • 173
    • 174
    • 175
    • 176
    • 177
    • 178
    • 179
    • 180
    • 181
    • 182
    • 183
    • 184
    • 185
    • 186
    • 187
    • 188
    • 189
    • 190
    • 191
    • 192
    • 193
    • 194
    • 195
    • 196
    • 197
    • 198
    • 199
    • 200
    • 201

    安装并配置 kvm 组件

    [root@compute02 nova]# yum -y install qemu-kvm-common-ev qemu-kvm-tools qemu-kvm-ev libvirt-daemon-kvm qemu-guest-agent qemu-img-ev
    Loaded plugins: fastestmirror, langpacks
    Repository base is listed more than once in the configuration
    Repository updates is listed more than once in the configuration
    Repository extras is listed more than once in the configuration
    Loading mirror speeds from cached hostfile
     * base: mirrors.ustc.edu.cn
     * extras: mirrors.ustc.edu.cn
     * updates: mirrors.ustc.edu.cn
    Package 10:qemu-kvm-common-ev-2.12.0-44.1.el7_8.1.x86_64 already installed and latest version
    Package qemu-kvm-tools is obsoleted by qemu-kvm-tools-ev, trying to install 10:qemu-kvm-tools-ev-2.12.0-44.1.el7_8.1.x86_64 instead
    Package 10:qemu-kvm-ev-2.12.0-44.1.el7_8.1.x86_64 already installed and latest version
    Package libvirt-daemon-kvm-4.5.0-36.el7_9.5.x86_64 already installed and latest version
    Package 10:qemu-guest-agent-2.12.0-3.el7.x86_64 already installed and latest version
    Package 10:qemu-img-ev-2.12.0-44.1.el7_8.1.x86_64 already installed and latest version
    Resolving Dependencies
    --> Running transaction check
    ---> Package qemu-kvm-tools-ev.x86_64 10:2.12.0-44.1.el7_8.1 will be installed
    --> Finished Dependency Resolution
    
    Dependencies Resolved
    
    =====================================================================================================================================
     Package                          Arch                  Version                                  Repository                     Size
    =====================================================================================================================================
    Installing:
    # Master libvirt daemon configuration file
    #
    # For further information consult https://libvirt.org/format.html
    #
    # NOTE: the tests/daemon-conf regression test script requires
    # that each "PARAMETER = VALUE" line in this file have the parameter
    # name just after a leading "#".
    
    #################################################################
    #
    # Network connectivity controls
    #
    
    # Flag listening for secure TLS connections on the public TCP/IP port.
    # NB, must pass the --listen flag to the libvirtd process for this to
    # have any effect.
    #
    # It is necessary to setup a CA and issue server certificates before
    # using this capability.
    #
    # This is enabled by default, uncomment this to disable it
    listen_tls = 0
    
    # Listen for unencrypted TCP connections on the public TCP/IP port.
    # NB, must pass the --listen flag to the libvirtd process for this to
    # have any effect.
    #
    # Using the TCP socket requires SASL authentication by default. Only
    # SASL mechanisms which support data encryption are allowed. This is
    # DIGEST_MD5 and GSSAPI (Kerberos5)
    #
    # This is disabled by default, uncomment this to enable it.
    listen_tcp = 1
    
    
    
    # Override the port for accepting secure TLS connections
    # This can be a port number, or service name
    #
    #tls_port = "16514"
    
    # Override the port for accepting insecure TCP connections
    # This can be a port number, or service name
    #
    tcp_port = "16509"
    
    
    # Override the default configuration which binds to all network
    # interfaces. This can be a numeric IPv4/6 address, or hostname
    #
    # If the libvirtd service is started in parallel with network
    # startup (e.g. with systemd), binding to addresses other than
    # the wildcards (0.0.0.0/::) might not be available yet.
    #
    listen_addr = "192.168.182.132"
    
    
    # Flag toggling mDNS advertizement of the libvirt service.
    #
    # Alternatively can disable for all services on a host by
    # stopping the Avahi daemon
    #
    # This is disabled by default, uncomment this to enable it
    #mdns_adv = 1
    
    # Override the default mDNS advertizement name. This must be
    # unique on the immediate broadcast network.
    #
    # The default is "Virtualization Host HOSTNAME", where HOSTNAME
    # is substituted for the short hostname of the machine (without domain)
    #
    #mdns_name = "Virtualization Host Joe Demo"
    
    
    #################################################################
    #
    # UNIX socket access controls
    #
    
    # Set the UNIX domain socket group ownership. This can be used to
    # allow a 'trusted' set of users access to management capabilities
    # without becoming root.
    #
    /auth_t
    # If the unix_sock_rw_perms are changed you may wish to enable
    # an authentication mechanism here
    #auth_unix_rw = "none"
    
    # Change the authentication scheme for TCP sockets.
    #
    # If you don't enable SASL, then all TCP traffic is cleartext.
    # Don't do this outside of a dev/test scenario. For real world
    # use, always enable SASL and use the GSSAPI or DIGEST-MD5
    # mechanism in /etc/sasl2/libvirt.conf
    #auth_tcp = "sasl"
    auth_tcp ="none"
    
    # Change the authentication scheme for TLS sockets.
    #
    # TLS sockets already have encryption provided by the TLS
    # layer, and limited authentication is done by certificates
    #
    # It is possible to make use of any SASL authentication
    # mechanism as well, by using 'sasl' for this option
    #auth_tls = "none"
    
    "/etc/libvirt/libvirtd.conf" 494L, 16546C written
     qemu-kvm-tools-ev                x86_64                10:2.12.0-44.1.el7_8.1                   centos-qemu-ev                558 k
    #KRB5_KTNAME=/etc/libvirt/krb5.tab
    
    # Override the QEMU/SDL default audio driver probing when
    # starting virtual machines using SDL graphics
    #
    # NB these have no effect for VMs using VNC, unless vnc_allow_host_audio
    # is enabled in /etc/libvirt/qemu.conf
    #QEMU_AUDIO_DRV=sdl
    #
    #SDL_AUDIODRIVER=pulse
    
    # Override the maximum number of opened files.
    # This only works with traditional init scripts.
    # In the systemd world, the limit can only be changed by overriding
    # LimitNOFILE for libvirtd.service. To do that, just create a *.conf
    # file in /etc/systemd/system/libvirtd.service.d/ (for example
    # /etc/systemd/system/libvirtd.service.d/openfiles.conf) and write
    # the following two lines in it:
    #   [Service]
    #   LimitNOFILE=2048
    #
    #LIBVIRTD_NOFILES_LIMIT=2048
    
    # Override the default config file
    # NOTE: This setting is no longer honoured if using
    # systemd. Set '--config /etc/libvirt/libvirtd.conf'
    # in LIBVIRTD_ARGS instead.
    #LIBVIRTD_CONFIG=/etc/libvirt/libvirtd.conf
    
    # Listen for TCP/IP connections
    # NB. must setup TLS/SSL keys prior to using this
    LIBVIRTD_ARGS="--listen"
    
    # Override Kerberos service keytab for SASL/GSSAPI
    #KRB5_KTNAME=/etc/libvirt/krb5.tab
    
    # Override the QEMU/SDL default audio driver probing when
    # starting virtual machines using SDL graphics
    #
    # NB these have no effect for VMs using VNC, unless vnc_allow_host_audio
    # is enabled in /etc/libvirt/qemu.conf
    #QEMU_AUDIO_DRV=sdl
    #
    #SDL_AUDIODRIVER=pulse
    
    "/etc/sysconfig/libvirtd" 33L, 1135C written
    Transaction Summary
    =====================================================================================================================================
    Install  1 Package
    
    Total download size: 558 k
    Installed size: 822 k
    Downloading packages:
    qemu-kvm-tools-ev-2.12.0-44.1.el7_8.1.x86_64.rpm                                                              | 558 kB  00:00:00     
    Running transaction check
    Running transaction test
    Transaction test succeeded
    Running transaction
      Installing : 10:qemu-kvm-tools-ev-2.12.0-44.1.el7_8.1.x86_64                                                                   1/1 
      Verifying  : 10:qemu-kvm-tools-ev-2.12.0-44.1.el7_8.1.x86_64                                                                   1/1 
    
    Installed:
      qemu-kvm-tools-ev.x86_64 10:2.12.0-44.1.el7_8.1                                                                                    
    
    Complete!
    #修改配置文件 /etc/libvirt/libvirtd.conf
    # cat libvirtd.conf |grep -v "^#" |grep -v "^$"
    listen_tls = 0
    listen_tcp = 1
    tcp_port = "16509"
    # 计算节点 compute02 上要修改成 192.168.59.32
    listen_addr = "192.168.59.31"
    auth_tcp = "none"
    
    [root@compute02 nova]# vi  /etc/libvirt/libvirtd.conf
    [root@compute02 nova]# vi /etc/sysconfig/libvirtd
    #修改 /etc/sysconfig/libvirtd
    LIBVIRTD_ARGS="--listen"
    [root@compute02 nova]# vi /etc/sysconfig/libvirtd
    [root@compute02 nova]# 
    #启动 libvirtd 、 nova-compute 服务,并设置成开机自启动
    [root@compute01 nova]#  systemctl enable libvirtd.service openstack-nova-compute.service
    Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-nova-compute.service to /usr/lib/systemd/system/openstack-nova-compute.service.
    [root@compute01 nova]# systemctl restart libvirtd.service openstack-nova-compute.service
    [root@compute01 nova]# systemctl status libvirtd.service openstack-nova-compute.service
    ● libvirtd.service - Virtualization daemon
       Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled; vendor preset: enabled)
       Active: active (running) since Thu 2022-11-24 19:55:36 CST; 22s ago
         Docs: man:libvirtd(8)
               https://libvirt.org
     Main PID: 22631 (libvirtd)
        Tasks: 19 (limit: 32768)
       CGroup: /system.slice/libvirtd.service
               ├─ 2202 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr/libexec/l...
               ├─ 2203 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr/libexec/l...
               └─22631 /usr/sbin/libvirtd --listen
    
    Nov 24 19:55:30 compute01 systemd[1]: Starting Virtualization daemon...
    Nov 24 19:55:36 compute01 systemd[1]: Started Virtualization daemon.
    Nov 24 19:55:43 compute01 dnsmasq[2202]: read /etc/hosts - 12 addresses
    Nov 24 19:55:43 compute01 dnsmasq[2202]: read /var/lib/libvirt/dnsmasq/default.addnhosts - 0 addresses
    Nov 24 19:55:43 compute01 dnsmasq-dhcp[2202]: read /var/lib/libvirt/dnsmasq/default.hostsfile
    
    ● openstack-nova-compute.service - OpenStack Nova Compute Server
       Loaded: loaded (/usr/lib/systemd/system/openstack-nova-compute.service; enabled; vendor preset: disabled)
       Active: active (running) since Thu 2022-11-24 19:55:57 CST; 2s ago
     Main PID: 22649 (nova-compute)
        Tasks: 22
       CGroup: /system.slice/openstack-nova-compute.service
               └─22649 /usr/bin/python2 /usr/bin/nova-compute
    
    Nov 24 19:55:36 compute01 systemd[1]: Starting OpenStack Nova Compute Server...
    Nov 24 19:55:57 compute01 systemd[1]: Started OpenStack Nova Compute Server.
    [root@compute01 nova]# 
    #查看
    [root@compute01 nova]# ^C
    [root@compute01 nova]# netstat -atnp |grep 16509
    tcp        0      0 192.168.182.131:16509   0.0.0.0:*               LISTEN      22631/libvirtd      
    [root@compute01 nova]# virsh version
    Compiled against library: libvirt 4.5.0
    Using library: libvirt 4.5.0
    Using API: QEMU 4.5.0
    Running hypervisor: QEMU 2.12.0
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75
    • 76
    • 77
    • 78
    • 79
    • 80
    • 81
    • 82
    • 83
    • 84
    • 85
    • 86
    • 87
    • 88
    • 89
    • 90
    • 91
    • 92
    • 93
    • 94
    • 95
    • 96
    • 97
    • 98
    • 99
    • 100
    • 101
    • 102
    • 103
    • 104
    • 105
    • 106
    • 107
    • 108
    • 109
    • 110
    • 111
    • 112
    • 113
    • 114
    • 115
    • 116
    • 117
    • 118
    • 119
    • 120
    • 121
    • 122
    • 123
    • 124
    • 125
    • 126
    • 127
    • 128
    • 129
    • 130
    • 131
    • 132
    • 133
    • 134
    • 135
    • 136
    • 137
    • 138
    • 139
    • 140
    • 141
    • 142
    • 143
    • 144
    • 145
    • 146
    • 147
    • 148
    • 149
    • 150
    • 151
    • 152
    • 153
    • 154
    • 155
    • 156
    • 157
    • 158
    • 159
    • 160
    • 161
    • 162
    • 163
    • 164
    • 165
    • 166
    • 167
    • 168
    • 169
    • 170
    • 171
    • 172
    • 173
    • 174
    • 175
    • 176
    • 177
    • 178
    • 179
    • 180
    • 181
    • 182
    • 183
    • 184
    • 185
    • 186
    • 187
    • 188
    • 189
    • 190
    • 191
    • 192
    • 193
    • 194
    • 195
    • 196
    • 197
    • 198
    • 199
    • 200
    • 201
    • 202
    • 203
    • 204
    • 205
    • 206
    • 207
    • 208
    • 209
    • 210
    • 211
    • 212
    • 213
    • 214
    • 215
    • 216
    • 217
    • 218
    • 219
    • 220
    • 221
    • 222
    • 223
    • 224
    • 225
    • 226
    • 227
    • 228
    • 229
    • 230
    • 231
    • 232
    • 233
    • 234
    • 235
    • 236
    • 237
    • 238
    • 239
    • 240
    • 241
    • 242
    • 243
    • 244
    • 245
    • 246
    • 247
    • 248
    • 249
    • 250
    • 251
    • 252
    • 253
    • 254
    • 255
    • 256
    • 257

    验证 Nova
    在控制节点执行以下操作进行验证。

    [root@controller neutron]#  source /etc/keystone/admin-openrc.sh
    [root@controller neutron]#  openstack compute service list
    +----+----------------+------------+----------+---------+-------+----------------------------+
    | ID | Binary         | Host       | Zone     | Status  | State | Updated At                 |
    +----+----------------+------------+----------+---------+-------+----------------------------+
    |  1 | nova-conductor | controller | internal | enabled | up    | 2022-11-24T11:58:24.000000 |
    |  4 | nova-scheduler | controller | internal | enabled | up    | 2022-11-24T11:58:19.000000 |
    |  6 | nova-compute   | compute02  | nova     | enabled | up    | 2022-11-24T11:58:20.000000 |
    |  7 | nova-compute   | compute01  | nova     | enabled | up    | 2022-11-24T11:58:15.000000 |
    +----+----------------+------------+----------+---------+-------+----------------------------+
    [root@controller neutron]#  openstack compute service list --service nova-compute
    +----+--------------+-----------+------+---------+-------+----------------------------+
    | ID | Binary       | Host      | Zone | Status  | State | Updated At                 |
    +----+--------------+-----------+------+---------+-------+----------------------------+
    |  6 | nova-compute | compute02 | nova | enabled | up    | 2022-11-24T11:58:20.000000 |
    |  7 | nova-compute | compute01 | nova | enabled | up    | 2022-11-24T11:58:25.000000 |
    +----+--------------+-----------+------+---------+-------+----------------------------+
    [root@controller neutron]# openstack catalog list
    +-----------+-----------+-----------------------------------------+
    | Name      | Type      | Endpoints                               |
    +-----------+-----------+-----------------------------------------+
    | neutron   | network   | RegionOne                               |
    |           |           |   public: http://controller:9696        |
    |           |           | RegionOne                               |
    |           |           |   internal: http://controller:9696      |
    |           |           | RegionOne                               |
    |           |           |   admin: http://controller:9696         |
    |           |           |                                         |
    | nova      | compute   | RegionOne                               |
    |           |           |   admin: http://controller:8774/v2.1    |
    |           |           | RegionOne                               |
    |           |           |   public: http://controller:8774/v2.1   |
    |           |           | RegionOne                               |
    |           |           |   internal: http://controller:8774/v2.1 |
    |           |           |                                         |
    | placement | placement | RegionOne                               |
    |           |           |   public: http://controller:8778        |
    |           |           | RegionOne                               |
    |           |           |   admin: http://controller:8778         |
    |           |           | RegionOne                               |
    |           |           |   internal: http://controller:8778      |
    |           |           |                                         |
    | keystone  | identity  | RegionOne                               |
    |           |           |   public: http://controller:5000/v3/    |
    |           |           | RegionOne                               |
    |           |           |   internal: http://controller:5000/v3/  |
    |           |           | RegionOne                               |
    |           |           |   admin: http://controller:5000/v3/     |
    |           |           |                                         |
    | glance    | image     | RegionOne                               |
    |           |           |   public: http://controller:9292        |
    |           |           | RegionOne                               |
    |           |           |   admin: http://controller:9292         |
    |           |           | RegionOne                               |
    |           |           |   internal: http://controller:9292      |
    |           |           |                                         |
    +-----------+-----------+-----------------------------------------+
    [root@controller neutron]# 
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58

    虚拟 机创建报错,后检查发现有三处错误。计算节点/etc/neutron/plugins/ml2/linuxbridge_agent.iniIP地址配置错误。控制节点/etc/nova/nova.conf的IP地址配置错误。修改后重启服务

    [root@controller ml2]#  vi /etc/neutron/plugins/ml2/linuxbridge_agent.ini
    [root@controller ml2]#  vi /etc/nova/nova.conf
    [root@controller ml2]#  systemctl restart neutron-server.service neutron-linuxbridge-agent.service neutron-dhcp-agent.service neutron-metadata-agent.service
    neutron-l3-agent.service^C
    [root@controller ml2]#  systemctl enable neutron-server.service neutron-linuxbridge-agent.service neutron-dhcp-agent.service neutron-metadata-agent.service neutron-l3-agent.service
    [root@controller ml2]#  systemctl restart neutron-server.service neutron-linuxbridge-agent.service neutron-dhcp-agent.service neutron-metadata-agent.service neutron-l3-agent.service      
    [root@controller ml2]#  systemctl status neutron-server.service neutron-linuxbridge-agent.service neutron-dhcp-agent.service neutron-metadata-agent.service neutron-l3-agent.service   
    ● neutron-server.service - OpenStack Neutron Server
       Loaded: loaded (/usr/lib/systemd/system/neutron-server.service; enabled; vendor preset: disabled)
       Active: active (running) since Fri 2022-11-25 01:01:14 CST; 22s ago
     Main PID: 92022 (/usr/bin/python)
        Tasks: 7
       CGroup: /system.slice/neutron-server.service
               ├─92022 /usr/bin/python2 /usr/bin/neutron-server --config-file /usr/share/neutron...
               ├─92146 /usr/bin/python2 /usr/bin/neutron-server --config-file /usr/share/neutron...
               ├─92147 /usr/bin/python2 /usr/bin/neutron-server --config-file /usr/share/neutron...
               ├─92148 /usr/bin/python2 /usr/bin/neutron-server --config-file /usr/share/neutron...
               ├─92149 neutron-server: rpc worker (/usr/bin/python2 /usr/bin/neutron-server --co...
               ├─92150 neutron-server: rpc worker (/usr/bin/python2 /usr/bin/neutron-server --co...
               └─92151 neutron-server: rpc worker (/usr/bin/python2 /usr/bin/neutron-server --co...
    
    Nov 25 01:00:31 controller systemd[1]: Starting OpenStack Neutron Server...
    Nov 25 01:01:00 controller neutron-server[92022]: /usr/lib/python2.7/site-packages/paste/d...y.
    Nov 25 01:01:00 controller neutron-server[92022]: return pkg_resources.EntryPoint.parse("x...e)
    Nov 25 01:01:14 controller systemd[1]: Started OpenStack Neutron Server.
    
    ● neutron-linuxbridge-agent.service - OpenStack Neutron Linux Bridge Agent
       Loaded: loaded (/usr/lib/systemd/system/neutron-linuxbridge-agent.service; enabled; vendor preset: disabled)
       Active: active (running) since Fri 2022-11-25 01:00:34 CST; 1min 3s ago
      Process: 92027 ExecStartPre=/usr/bin/neutron-enable-bridge-firewall.sh (code=exited, status=0/SUCCESS)
     Main PID: 92034 (/usr/bin/python)
        Tasks: 1
       CGroup: /system.slice/neutron-linuxbridge-agent.service
               └─92034 /usr/bin/python2 /usr/bin/neutron-linuxbridge-agent --config-file /usr/sh...
    
    Nov 25 01:00:33 controller systemd[1]: Starting OpenStack Neutron Linux Bridge Agent...
    Nov 25 01:00:33 controller neutron-enable-bridge-firewall.sh[92027]: net.bridge.bridge-nf-ca...
    Nov 25 01:00:33 controller neutron-enable-bridge-firewall.sh[92027]: net.bridge.bridge-nf-ca...
    Nov 25 01:00:34 controller systemd[1]: Started OpenStack Neutron Linux Bridge Agent.
    Nov 25 01:01:05 controller sudo[92121]:  neutron : TTY=unknown ; PWD=/ ; USER=root ; COMMAND...
    Nov 25 01:01:17 controller sudo[92165]:  neutron : TTY=unknown ; PWD=/ ; USER=root ; COMM...onf
    
    ● neutron-dhcp-agent.service - OpenStack Neutron DHCP Agent
       Loaded: loaded (/usr/lib/systemd/system/neutron-dhcp-agent.service; enabled; vendor preset: disabled)
       Active: active (running) since Fri 2022-11-25 01:00:36 CST; 1min 0s ago
     Main PID: 92038 (/usr/bin/python)
        Tasks: 1
       CGroup: /system.slice/neutron-dhcp-agent.service
               └─92038 /usr/bin/python2 /usr/bin/neutron-dhcp-agent --config-file /usr/share/neu...
    
    Nov 25 01:00:36 controller systemd[1]: Started OpenStack Neutron DHCP Agent.
    Nov 25 01:01:17 controller sudo[92173]:  neutron : TTY=unknown ; PWD=/ ; USER=root ; COMM...onf
    
    ● neutron-metadata-agent.service - OpenStack Neutron Metadata Agent
       Loaded: loaded (/usr/lib/systemd/system/neutron-metadata-agent.service; enabled; vendor preset: disabled)
       Active: active (running) since Fri 2022-11-25 01:00:37 CST; 59s ago
     Main PID: 92044 (/usr/bin/python)
        Tasks: 3
       CGroup: /system.slice/neutron-metadata-agent.service
               ├─92044 /usr/bin/python2 /usr/bin/neutron-metadata-agent --config-file /usr/share...
               ├─92116 /usr/bin/python2 /usr/bin/neutron-metadata-agent --config-file /usr/share...
               └─92118 /usr/bin/python2 /usr/bin/neutron-metadata-agent --config-file /usr/share...
    
    Nov 25 01:00:37 controller systemd[1]: Started OpenStack Neutron Metadata Agent.
    
    ● neutron-l3-agent.service - OpenStack Neutron Layer 3 Agent
       Loaded: loaded (/usr/lib/systemd/system/neutron-l3-agent.service; enabled; vendor preset: disabled)
       Active: active (running) since Fri 2022-11-25 01:01:18 CST; 19s ago
     Main PID: 92187 (/usr/bin/python)
        Tasks: 1
       CGroup: /system.slice/neutron-l3-agent.service
               └─92187 /usr/bin/python2 /usr/bin/neutron-l3-agent --config-file /usr/share/neutr...
    
    Nov 25 01:01:18 controller systemd[1]: Started OpenStack Neutron Layer 3 Agent.
    Nov 25 01:01:32 controller sudo[92363]:  neutron : TTY=unknown ; PWD=/ ; USER=root ; COMMAND...
    Hint: Some lines were ellipsized, use -l to show in full.
    [root@controller ml2]# 
    [root@controller ml2]# openstack network agent list
    +--------------------------------------+--------------------+------------+-------------------+-------+-------+---------------------------+
    | ID                                   | Agent Type         | Host       | Availability Zone | Alive | State | Binary                    |
    +--------------------------------------+--------------------+------------+-------------------+-------+-------+---------------------------+
    | 13e7e110-69b7-4d22-996e-ffce956228e5 | DHCP agent         | controller | nova              | :-)   | UP    | neutron-dhcp-agent        |
    | 42570b9e-4a55-429d-842b-652938a807f3 | Linux bridge agent | compute02  | None              | :-)   | UP    | neutron-linuxbridge-agent |
    | 42fb233d-6a8f-4f73-bf39-922fc16fff42 | Linux bridge agent | compute01  | None              | :-)   | UP    | neutron-linuxbridge-agent |
    | 7de44ea6-8556-4a84-b687-33c827cc7cb3 | Linux bridge agent | controller | None              | :-)   | UP    | neutron-linuxbridge-agent |
    | c5afccc8-cdb4-4657-843d-63085871d19b | L3 agent           | controller | nova              | :-)   | UP    | neutron-l3-agent          |
    | e5161e41-85f1-46de-9092-5cdc393cf7b9 | Metadata agent     | controller | None              | :-)   | UP    | neutron-metadata-agent    |
    +--------------------------------------+--------------------+------------+-------------------+-------+-------+---------------------------+
    [root@controller ml2]# 
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75
    • 76
    • 77
    • 78
    • 79
    • 80
    • 81
    • 82
    • 83
    • 84
    • 85
    • 86
    • 87
    • 88
    • 89

    重建

    [root@controller ml2]# openstack server  delete vm01
    [root@controller ml2]#  openstack server create --flavor n1.nano --image cirros-0.4.0-x86_64 --nic net-id=public --security-group default vm01
    +-------------------------------------+------------------------------------------------------------+
    | Field                               | Value                                                      |
    +-------------------------------------+------------------------------------------------------------+
    | OS-DCF:diskConfig                   | MANUAL                                                     |
    | OS-EXT-AZ:availability_zone         |                                                            |
    | OS-EXT-SRV-ATTR:host                | None                                                       |
    | OS-EXT-SRV-ATTR:hypervisor_hostname | None                                                       |
    | OS-EXT-SRV-ATTR:instance_name       |                                                            |
    | OS-EXT-STS:power_state              | NOSTATE                                                    |
    | OS-EXT-STS:task_state               | scheduling                                                 |
    | OS-EXT-STS:vm_state                 | building                                                   |
    | OS-SRV-USG:launched_at              | None                                                       |
    | OS-SRV-USG:terminated_at            | None                                                       |
    | accessIPv4                          |                                                            |
    | accessIPv6                          |                                                            |
    | addresses                           |                                                            |
    | adminPass                           | 36vBKYA6ZM9s                                               |
    | config_drive                        |                                                            |
    | created                             | 2022-11-24T17:19:22Z                                       |
    | flavor                              | n1.nano (e773f585-163d-4037-a91a-a7653e3318cb)             |
    | hostId                              |                                                            |
    | id                                  | 8b3b7cd0-c337-4b92-8979-66e729cc4772                       |
    | image                               | cirros-0.4.0-x86_64 (85219bb3-2513-4792-9b5e-c51de301b4c3) |
    | key_name                            | None                                                       |
    | name                                | vm01                                                       |
    | progress                            | 0                                                          |
    | project_id                          | b069ab279ac147b6a16f9ff2107f7b1b                           |
    | properties                          |                                                            |
    | security_groups                     | name='07b44d58-1196-48de-b7b2-4e14f919b87c'                |
    | status                              | BUILD                                                      |
    | updated                             | 2022-11-24T17:19:22Z                                       |
    | user_id                             | ddcbc0b63d2c4fcd93bdfbf6c8bbd279                           |
    | volumes_attached                    |                                                            |
    +-------------------------------------+------------------------------------------------------------+
    [root@controller ml2]# openstack server  list                                                  +--------------------------------------+------+--------+------------------------+---------------------+---------+
    | ID                                   | Name | Status | Networks               | Image               | Flavor  |
    +--------------------------------------+------+--------+------------------------+---------------------+---------+
    | 8b3b7cd0-c337-4b92-8979-66e729cc4772 | vm01 | ACTIVE | public=192.168.182.229 | cirros-0.4.0-x86_64 | n1.nano |
    +--------------------------------------+------+--------+------------------------+---------------------+---------+
    [root@controller ml2]# 
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
  • 相关阅读:
    Github爆火,阿里最新发布的《高并发核心编程笔记》PDF文档
    springboot中的注解
    07、SpringBoot+微信支付 -->处理超时订单(定时查询、核实微信支付平台的订单、调用微信支付平台查单接口、更新本地订单状态、记录支付日志)
    Lambda 在集合中的应用
    北斗GPS网络时钟系统(子母钟系统)助力智慧教室建设
    Redis面试
    Scrum和Kanban方法的结合:Scrumban的实施指南
    CentOS在应用程序菜单中创建快捷方式
    tf.placeholder
    Swift网络爬虫与数据可视化的结合 (1)
  • 原文地址:https://blog.csdn.net/weixin_44048054/article/details/128021969