2022-10-28
#10 [학습서] OpenStack 설치 학습서 - 6.Nova (1/2)
2022-10-28
Tasks

OpenStack 설치 학습서#


6. Nova#

OpenStack Compute service는 클라우드 컴퓨팅 시스템을 호스팅하고 관리하는 서비스이며, 해당 서비스는 Nova라고 합니다.

Nova은 Keystone, Glance, Placement 설치 이후에 설치하는 서비스입니다. Controller node에는 compute management와 api 등을 설치하고, Compute node는 compute를 위한 하이퍼바이저 등을 설치합니다.


  • Controller node
    • 사전설정
      CONTROLLER_IP=192.168.0.150
      OPENSTACK_PASSWORD=passwds
      
    • 데이터베이스에 서비스 생성
      mysql -e "CREATE DATABASE nova_api;"
      mysql -e "CREATE DATABASE nova;"
      mysql -e "CREATE DATABASE nova_cell0;"
      mysql -e "GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'localhost' IDENTIFIED BY '${OPENSTACK_PASSWORD}';"
      mysql -e "GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'%' IDENTIFIED BY '${OPENSTACK_PASSWORD}';"
      mysql -e "GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' IDENTIFIED BY '${OPENSTACK_PASSWORD}';"
      mysql -e "GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' IDENTIFIED BY '${OPENSTACK_PASSWORD}';"
      mysql -e "GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'localhost' IDENTIFIED BY '${OPENSTACK_PASSWORD}';"
      mysql -e "GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'%' IDENTIFIED BY '${OPENSTACK_PASSWORD}';"
      mysql -e "FLUSH PRIVILEGES;"
      
    • admin 커맨드 액세스
      . admin-openrc
      
    • 서비스 자격 증명 및 생성
      openstack user create --domain default --password ${OPENSTACK_PASSWORD} nova
      openstack role add --project service --user nova admin
      openstack service create --name nova --description "OpenStack Compute" compute
      
      • 6-1.png
    • API 엔드포인트를 생성
      openstack endpoint create --region RegionOne compute public http://${CONTROLLER_IP}:8774/v2.1
      openstack endpoint create --region RegionOne compute internal http://${CONTROLLER_IP}:8774/v2.1
      openstack endpoint create --region RegionOne compute admin http://${CONTROLLER_IP}:8774/v2.1
      
      • 6-2.png
    • 패키지 설치 및 설정
      apt install -y nova-api nova-conductor nova-novncproxy nova-scheduler
      # nova.conf 파일 수정
      crudini --set /etc/nova/nova.conf api_database connection mysql+pymysql://nova:${OPENSTACK_PASSWORD}@${CONTROLLER_IP}/nova_api
      crudini --set /etc/nova/nova.conf database connection mysql+pymysql://nova:${OPENSTACK_PASSWORD}@${CONTROLLER_IP}/nova
      crudini --set /etc/nova/nova.conf DEFAULT transport_url rabbit://openstack:${OPENSTACK_PASSWORD}@${CONTROLLER_IP}:5672/
      crudini --set /etc/nova/nova.conf DEFAULT my_ip ${CONTROLLER_IP}
      crudini --set /etc/nova/nova.conf api auth_strategy keystone
      crudini --set /etc/nova/nova.conf keystone_authtoken www_authenticate_uri http://${CONTROLLER_IP}:5000/
      crudini --set /etc/nova/nova.conf keystone_authtoken auth_url http://${CONTROLLER_IP}:5000/
      crudini --set /etc/nova/nova.conf keystone_authtoken memcached_servers ${CONTROLLER_IP}:11211
      crudini --set /etc/nova/nova.conf keystone_authtoken auth_type password
      crudini --set /etc/nova/nova.conf keystone_authtoken project_domain_name Default
      crudini --set /etc/nova/nova.conf keystone_authtoken user_domain_name Default
      crudini --set /etc/nova/nova.conf keystone_authtoken project_name service
      crudini --set /etc/nova/nova.conf keystone_authtoken username nova
      crudini --set /etc/nova/nova.conf keystone_authtoken password ${OPENSTACK_PASSWORD}
      crudini --set /etc/nova/nova.conf vnc enabled true
      crudini --set /etc/nova/nova.conf vnc server_listen ${CONTROLLER_IP}
      crudini --set /etc/nova/nova.conf vnc server_proxyclient_address ${CONTROLLER_IP}
      crudini --set /etc/nova/nova.conf glance api_servers http://${CONTROLLER_IP}:9292
      crudini --set /etc/nova/nova.conf oslo_concurrency lock_path /var/lib/nova/tmp
      crudini --set /etc/nova/nova.conf placement region_name RegionOne
      crudini --set /etc/nova/nova.conf placement project_domain_name Default
      crudini --set /etc/nova/nova.conf placement project_name service
      crudini --set /etc/nova/nova.conf placement auth_type password
      crudini --set /etc/nova/nova.conf placement user_domain_name Default
      crudini --set /etc/nova/nova.conf placement auth_url http://${CONTROLLER_IP}:5000/v3
      crudini --set /etc/nova/nova.conf placement username placement
      crudini --set /etc/nova/nova.conf placement password ${OPENSTACK_PASSWORD}
      
      • 6-3.png
    • 데이터베이스 설정
      su -s /bin/sh -c "nova-manage api_db sync" nova
      su -s /bin/sh -c "nova-manage cell_v2 map_cell0" nova
      su -s /bin/sh -c "nova-manage cell_v2 create_cell --name=cell1 --verbose" nova
      su -s /bin/sh -c "nova-manage db sync" nova
      su -s /bin/sh -c "nova-manage cell_v2 list_cells" nova
      
    • 서비스 재시작
      service nova-api restart
      service nova-scheduler restart
      service nova-conductor restart
      service nova-novncproxy restart
      
      • 6-4.png
Comment 0

Add a comment