OpenStack Caracal : Compute ノードを追加する (GPU)2024/04/09 |
GPU を搭載した Compute ノードを追加して、仮想マシンインスタンスで GPU が利用できるように設定します。
当例では以下のような環境を例に、新たに GPU を搭載した [node02.srv.world] を Compute ノードとして追加します。
------------+--------------------------+--------------------------+------------ | | | eth0|10.0.0.30 eth0|10.0.0.50 eth0|10.0.0.51 +-----------+-----------+ +-----------+-----------+ +-----------+-----------+ | [ dlp.srv.world ] | | [ network.srv.world ] | | [ node01.srv.world ] | | (Control Node) | | (Network Node) | | (Compute Node) | | | | | | | | MariaDB RabbitMQ | | Neutron L2/L3 Agent | | Libvirt | | Memcached Nginx | | Neutron Metadata | | Nova Compute | | Keystone httpd | | Open vSwitch | | Neutron L2 Agent | | Glance Nova API | | | | Open vSwitch | | Neutron Server | | | | | | Neutron Metadata | | | | | +-----------------------+ +-----------------------+ +-----------------------+ ------------+------------ | eth0|10.0.0.52 +-----------+-----------+ | [ node02.srv.world ] | | (Compute Node (GPU)) | | | | Libvirt | | Nova Compute | | Neutron L2 Agent | | Open vSwitch | +-----------------------+ |
[1] |
追加する Compute ノードに
こちらの [1] を参考にして GPU パススルーの設定を適用しておきます。
|
[2] | |
[3] | 追加した Nova-Compute に、GPU パススルー用の設定をします。 |
root@node02:~# lspci -nn | grep -i nvidia 81:00.0 VGA compatible controller [0300]: NVIDIA Corporation GA104 [GeForce RTX 3060] [10de:2487] (rev a1) 81:00.1 Audio device [0403]: NVIDIA Corporation GA104 High Definition Audio Controller [10de:228b] (rev a1)
root@node02:~#
vi /etc/nova/nova.conf
# 最終行に追記
# パススルーしたいデバイスの [vendor_id], [product_id] を追記
[pci]
passthrough_whitelist = { "vendor_id": "10de", "product_id": "2487" }
systemctl restart nova-compute
|
[4] | Control ノードで Nova の設定を変更します。 |
root@dlp ~(keystone)#
vi /etc/nova/nova.conf
# 最終行に追記
# 対象の Compute ノードでパススルー設定したデバイスの [vendor_id], [product_id] を追記
# [name] は任意の名称
[pci]
alias: { "vendor_id":"10de", "product_id":"2487", "device_type":"type-PCI", "name":"RTX-3060" }
[filter_scheduler]
enabled_filters = PciPassthroughFilter
root@dlp ~(keystone)#
systemctl restart nova-api nova-scheduler
# GPU 用の [flavor] 作成 root@dlp ~(keystone)# openstack flavor create --id 5 --vcpus 4 --ram 8192 --disk 20 --property "pci_passthrough:alias"="RTX-3060:1" gpu1.small +----------------------------+------------------------------------+ | Field | Value | +----------------------------+------------------------------------+ | OS-FLV-DISABLED:disabled | False | | OS-FLV-EXT-DATA:ephemeral | 0 | | description | None | | disk | 20 | | id | 5 | | name | gpu1.small | | os-flavor-access:is_public | True | | properties | pci_passthrough:alias='RTX-3060:1' | | ram | 8192 | | rxtx_factor | 1.0 | | swap | 0 | | vcpus | 4 | +----------------------------+------------------------------------+root@dlp ~(keystone)# openstack flavor list +----+------------+------+------+-----------+-------+-----------+ | ID | Name | RAM | Disk | Ephemeral | VCPUs | Is Public | +----+------------+------+------+-----------+-------+-----------+ | 1 | m1.tiny | 2048 | 10 | 0 | 1 | True | | 2 | m1.small | 4096 | 10 | 0 | 2 | True | | 3 | m1.medium | 8192 | 10 | 0 | 4 | True | | 4 | m2.medium | 8192 | 10 | 10 | 4 | True | | 5 | gpu1.small | 8192 | 20 | 0 | 4 | True | +----+------------+------+------+-----------+-------+-----------+ |
[5] | 任意の Openstack ユーザーで GPU インスタンスを作成して動作確認します。 |
ubuntu@dlp ~(keystone)$ openstack network list +---------------------------------+---------+----------------------------------+ | ID | Name | Subnets | +---------------------------------+---------+----------------------------------+ | 24288203-5512-40c5-8bcb- | public | 0b39a7b6-3b03-4704-ba32- | | aed6dffc2bc1 | | 89e5894bad2c | | b28ad879-8bbf-40fe-b2fb- | private | 42dd9fb5-a0f2-4556-b896- | | af772cf88a8a | | 6257cb5119f6 | +---------------------------------+---------+----------------------------------+ubuntu@dlp ~(keystone)$ netID=$(openstack network list | grep private | awk '{ print $2 }')
ubuntu@dlp ~(keystone)$
ubuntu@dlp ~(keystone)$ openstack server create --flavor gpu1.small --image Ubuntu2204 --security-group secgroup01 --nic net-id=$netID --key-name mykey Ubuntu-2204GPU
openstack server list +-------------+-------------+---------+--------------+------------+------------+ | ID | Name | Status | Networks | Image | Flavor | +-------------+-------------+---------+--------------+------------+------------+ | a30b6a48- | Ubuntu- | ACTIVE | private=192. | Ubuntu2204 | gpu1.small | | 8b7c-428a- | 2204GPU | | 168.100.229 | | | | b652- | | | | | | | 6c3bdf330ae | | | | | | | 9 | | | | | | | e7feb65c- | Ubuntu-2204 | SHUTOFF | private=10.0 | Ubuntu2204 | m1.small | | 1482-48a9- | | | .0.250, 192. | | | | 9d45- | | | 168.100.188 | | | | e74196a5ea9 | | | | | | | 2 | | | | | | +-------------+-------------+---------+--------------+------------+------------+ubuntu@dlp ~(keystone)$ openstack floating ip create public +---------------------+--------------------------------------+ | Field | Value | +---------------------+--------------------------------------+ | created_at | 2024-04-09T05:11:23Z | | description | | | dns_domain | None | | dns_name | None | | fixed_ip_address | None | | floating_ip_address | 10.0.0.237 | | floating_network_id | 24288203-5512-40c5-8bcb-aed6dffc2bc1 | | id | 90a54b31-a191-4988-afe7-7be7719922b1 | | name | 10.0.0.237 | | port_details | None | | port_id | None | | project_id | 2bcdd2fecf1d4a8c8faf87f1232cf365 | | qos_policy_id | None | | revision_number | 0 | | router_id | None | | status | DOWN | | subnet_id | None | | tags | [] | | updated_at | 2024-04-09T05:11:23Z | +---------------------+--------------------------------------+ubuntu@dlp ~(keystone)$ openstack server add floating ip Ubuntu-2204GPU 10.0.0.237 ubuntu@dlp ~(keystone)$ ssh ubuntu@10.0.0.237
The authenticity of host '10.0.0.237 (10.0.0.237)' can't be established.
ED25519 key fingerprint is SHA256:3jurTu5EcAET+hbboq+TCSuL6W1W16UoJjCOseC/Ymg.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '10.0.0.237' (ED25519) to the list of known hosts.
Welcome to Ubuntu 22.04.4 LTS (GNU/Linux 5.15.0-101-generic x86_64)
.....
.....
ubuntu@ubuntu-2204gpu:~$ubuntu@ubuntu-2204gpu:~$ lspci | grep -i nvidia 00:05.0 VGA compatible controller: NVIDIA Corporation GA104 [GeForce RTX 3060] (rev a1) |
Sponsored Link |