Incus/cryoSPARC をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
1台のノードに複数のcryoSPARCを稼働させるためにlibvirtでv...
様相はこんな感じ
&ref(2026y03m04d_003414969.png,nolink,noborder);
|BGCOLOR(YELLOW):ホスト名|BGCOLOR(YELLOW):ipアドレス|BGCO...
|rockylinux9.sybyl.local|192.168.0.160|/dev/sda(192G,syst...
***bridgeインターフェース [#t1f51b9d]
まず複数のコンテナを扱えるようにするためにnicをbridgeにし...
#code(nonumber){{
[root@rockylinux9 ~]# ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue sta...
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp6s18: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qd...
link/ether bc:24:11:46:92:95 brd ff:ff:ff:ff:ff:ff
[root@rockylinux9 ~]# nmcli conn
NAME UUID TYPE ...
enp6s18 8b4396b6-7fc4-3401-a679-148b8a9aa770 ethernet ...
lo b177e43d-7d88-4344-bdf3-0fa4f75922e0 loopback lo
[root@rockylinux9 ~]# nmcli conn add type bridge ifname b...
[root@rockylinux9 ~]# nmcli conn
NAME UUID TYPE ...
enp6s18 8b4396b6-7fc4-3401-a679-148b8a9aa770 ethernet ...
br0 47e93d7c-f2ec-4341-ab71-f05b7b891741 bridge ...
lo b177e43d-7d88-4344-bdf3-0fa4f75922e0 loopback lo
[root@rockylinux9 ~]# nmcli conn add type bridge-slave if...
[root@rockylinux9 ~]# nmcli conn
NAME UUID ...
enp6s18 8b4396b6-7fc4-3401-a679-148b8a9aa77...
br0 47e93d7c-f2ec-4341-ab71-f05b7b89174...
lo b177e43d-7d88-4344-bdf3-0fa4f75922e...
bridge-slave-enp6s18 d92bc8f8-a168-4a0d-985f-8f495166cfd...
[root@rockylinux9 ~]# nmcli conn modify br0 \
bridge.stp no \
ipv4.method manual ipv4.addresses "192.168.0....
ipv4.gateway "192.168.0.1" \
ipv4.dns "192.168.0.3" \
ipv4.dns-search "sybyl.local" \
ipv4.never-default no \
ipv6.method "disabled"
[root@rockylinux9 ~]# nmcli conn delete enp6s18 ; reboot
(reboot後)
[root@rockylinux9 ~]# nmcli conn
NAME UUID ...
br0 47e93d7c-f2ec-4341-ab71-f05b7b89174...
bridge-slave-enp6s18 d92bc8f8-a168-4a0d-985f-8f495166cfd...
lo 99c2d2cc-d1fc-437f-8dd0-37bf3d175e7...
[root@rockylinux9 ~]#
}}
incusサーバのnic構成が変更できないならmacvlanで行うが、ホ...
***incusサーバ構築 [#qcf0a60d]
[[Incus]]と同様
#code(nonumber){{
[root@rockylinux9 ~]# cat /etc/redhat-release
Rocky Linux release 9.7 (Blue Onyx)
[root@rockylinux9 ~]# dnf copr enable neil/incus
[root@rockylinux9 ~]# dnf install epel-release
[root@rockylinux9 ~]# dnf config-manager --enable crb
[root@rockylinux9 ~]# dnf install incus incus-tools
[root@rockylinux9 ~]# systemctl enable incus --now
}}
っでincusの初期設定
#code(nonumber){{
[root@rockylinux9 ~]# incus admin init
Would you like to use clustering? (yes/no) [default=no]:
Do you want to configure a new storage pool? (yes/no) [de...
Name of the new storage pool [default=default]:
Name of the storage backend to use (dir, lvm, lvmcluster)...
Where should this storage pool store its data? [default=/...
Would you like to create a new local network bridge? (yes...
Would you like to use an existing bridge or host interfac...
Would you like the server to be available over the networ...
Would you like stale cached images to be updated automati...
Would you like a YAML "init" preseed to be printed? (yes/...
[root@rockylinux9 ~]#
}}
として「/var/lib/incus/storage-pools/default」にコンテナ...
***incus管理者アカウントとユーザ名前空間の設定 [#udf11656]
incusのインストール時に用意される「incus-admin」に所属す...
#code(nonumber){{
[root@rockylinux9 ~]# useradd -s /bin/bash incus-supervisor
[root@rockylinux9 ~]# usermod -aG incus-admin incus-super...
[root@rockylinux9 ~]# id incus-supervisor
uid=1001(incus-supervisor) gid=1001(incus-supervisor) gro...
[root@rockylinux9 ~]#
}}
次に大事なのですが、incusコンテナで使用するアカウントのui...
特権コンテナにするか「raw.idmap」で融通させる必要がある
特権モードは単にコンテナに対して「incus config set <conta...
ここでは「raw.idmap」を使います
ホストのアカウント「incus-supervisor」を作成したので既存...
#code(nonumber){{
[root@rockylinux9 ~]# cat /etc/subuid
saber:100000:65536
incus-supervisor:165536:65536
[root@rockylinux9 ~]# cat /etc/subgid
saber:100000:65536
incus-supervisor:165536:65536
[root@rockylinux9 ~]#
}}
incusデーモンもこのsubuidを使うのでincus-supervisorの末尾...
#code(nonumber){{
[root@rockylinux9 ~]# echo "root:231072:65536" >> /etc/su...
[root@rockylinux9 ~]# echo "root:231072:65536" >> /etc/su...
[root@rockylinux9 ~]# systemctl restart incus # 構成が変...
}}
これはコンテナ内のUID:0が、ホスト側ではUID:165536に該当し...
&size(10){なのでnfs側で 65536 より大きいUID/GIDの場合はこ...
***コンテナの作成 [#y2d3cf6a]
コンテナを作成する際にprofileが読み込まれ作られます。初め...
#code(nonumber){{
[incus-supervisor@rockylinux9 ~]$ incus profile list
To start your first container, try: incus launch images:u...
Or for a virtual machine: incus launch images:ubuntu/22.0...
+---------+-----------------------+---------+
| NAME | DESCRIPTION | USED BY |
+---------+-----------------------+---------+
| default | Default Incus profile | 0 |
+---------+-----------------------+---------+
[incus-supervisor@rockylinux9 ~]$ incus profile show defa...
config: {}
description: Default Incus profile
devices:
root:
path: /
pool: default
type: disk
name: default
used_by: []
project: default
[incus-supervisor@rockylinux9 ~]$
}}
現在profileは1つあって、「default」という名称。中身はnic...
では「cs1」というrockylinux9なコンテナを作ってみます
#code(nonumber){{
[incus-supervisor@rockylinux9 ~]$ incus launch images:roc...
Launching cs1
The instance you are starting doesn't have any network at...
To create a new network, use: incus network create
To attach a network to an instance, use: incus network ...
[incus-supervisor@rockylinux9 ~]$
[incus-supervisor@rockylinux9 ~]$ incus list
+------+---------+------+------+-----------+-----------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
+------+---------+------+------+-----------+-----------+
| cs1 | RUNNING | | | CONTAINER | 0 |
+------+---------+------+------+-----------+-----------+
[incus-supervisor@rockylinux9 ~]$
}}
っとコンテナ cs1 が出来ました
これでnicを付けて、ipを振ります
#code(nonumber){{
incus config device add cs1 eth0 nic nictype=bridged pare...
incus exec cs1 -- ip addr add 192.168.0.230/24 dev eth0
incus exec cs1 -- ip link set eth0 up
incus exec cs1 -- ip route add default via 192.168.0.1
incus exec cs1 -- sh -c 'echo "nameserver 192.168.0.1" > ...
}}
とコンテナの環境整備を行って、この段階で外部からパッケー...
#code(nonumber){{
incus exec cs1 -- bash
dnf install bind-utils NetworkManager-tui openssh-server
vi /etc/ssh/sshd_config
systemctl enable sshd --now
passwd root
systemctl start NetworkManager --now
nmtui
groupadd -g 1000 gfo
useradd -u 1000 -g 1000 -d /home/saber -s /bin/bash -m ...
}}
終了行:
1台のノードに複数のcryoSPARCを稼働させるためにlibvirtでv...
様相はこんな感じ
&ref(2026y03m04d_003414969.png,nolink,noborder);
|BGCOLOR(YELLOW):ホスト名|BGCOLOR(YELLOW):ipアドレス|BGCO...
|rockylinux9.sybyl.local|192.168.0.160|/dev/sda(192G,syst...
***bridgeインターフェース [#t1f51b9d]
まず複数のコンテナを扱えるようにするためにnicをbridgeにし...
#code(nonumber){{
[root@rockylinux9 ~]# ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue sta...
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp6s18: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qd...
link/ether bc:24:11:46:92:95 brd ff:ff:ff:ff:ff:ff
[root@rockylinux9 ~]# nmcli conn
NAME UUID TYPE ...
enp6s18 8b4396b6-7fc4-3401-a679-148b8a9aa770 ethernet ...
lo b177e43d-7d88-4344-bdf3-0fa4f75922e0 loopback lo
[root@rockylinux9 ~]# nmcli conn add type bridge ifname b...
[root@rockylinux9 ~]# nmcli conn
NAME UUID TYPE ...
enp6s18 8b4396b6-7fc4-3401-a679-148b8a9aa770 ethernet ...
br0 47e93d7c-f2ec-4341-ab71-f05b7b891741 bridge ...
lo b177e43d-7d88-4344-bdf3-0fa4f75922e0 loopback lo
[root@rockylinux9 ~]# nmcli conn add type bridge-slave if...
[root@rockylinux9 ~]# nmcli conn
NAME UUID ...
enp6s18 8b4396b6-7fc4-3401-a679-148b8a9aa77...
br0 47e93d7c-f2ec-4341-ab71-f05b7b89174...
lo b177e43d-7d88-4344-bdf3-0fa4f75922e...
bridge-slave-enp6s18 d92bc8f8-a168-4a0d-985f-8f495166cfd...
[root@rockylinux9 ~]# nmcli conn modify br0 \
bridge.stp no \
ipv4.method manual ipv4.addresses "192.168.0....
ipv4.gateway "192.168.0.1" \
ipv4.dns "192.168.0.3" \
ipv4.dns-search "sybyl.local" \
ipv4.never-default no \
ipv6.method "disabled"
[root@rockylinux9 ~]# nmcli conn delete enp6s18 ; reboot
(reboot後)
[root@rockylinux9 ~]# nmcli conn
NAME UUID ...
br0 47e93d7c-f2ec-4341-ab71-f05b7b89174...
bridge-slave-enp6s18 d92bc8f8-a168-4a0d-985f-8f495166cfd...
lo 99c2d2cc-d1fc-437f-8dd0-37bf3d175e7...
[root@rockylinux9 ~]#
}}
incusサーバのnic構成が変更できないならmacvlanで行うが、ホ...
***incusサーバ構築 [#qcf0a60d]
[[Incus]]と同様
#code(nonumber){{
[root@rockylinux9 ~]# cat /etc/redhat-release
Rocky Linux release 9.7 (Blue Onyx)
[root@rockylinux9 ~]# dnf copr enable neil/incus
[root@rockylinux9 ~]# dnf install epel-release
[root@rockylinux9 ~]# dnf config-manager --enable crb
[root@rockylinux9 ~]# dnf install incus incus-tools
[root@rockylinux9 ~]# systemctl enable incus --now
}}
っでincusの初期設定
#code(nonumber){{
[root@rockylinux9 ~]# incus admin init
Would you like to use clustering? (yes/no) [default=no]:
Do you want to configure a new storage pool? (yes/no) [de...
Name of the new storage pool [default=default]:
Name of the storage backend to use (dir, lvm, lvmcluster)...
Where should this storage pool store its data? [default=/...
Would you like to create a new local network bridge? (yes...
Would you like to use an existing bridge or host interfac...
Would you like the server to be available over the networ...
Would you like stale cached images to be updated automati...
Would you like a YAML "init" preseed to be printed? (yes/...
[root@rockylinux9 ~]#
}}
として「/var/lib/incus/storage-pools/default」にコンテナ...
***incus管理者アカウントとユーザ名前空間の設定 [#udf11656]
incusのインストール時に用意される「incus-admin」に所属す...
#code(nonumber){{
[root@rockylinux9 ~]# useradd -s /bin/bash incus-supervisor
[root@rockylinux9 ~]# usermod -aG incus-admin incus-super...
[root@rockylinux9 ~]# id incus-supervisor
uid=1001(incus-supervisor) gid=1001(incus-supervisor) gro...
[root@rockylinux9 ~]#
}}
次に大事なのですが、incusコンテナで使用するアカウントのui...
特権コンテナにするか「raw.idmap」で融通させる必要がある
特権モードは単にコンテナに対して「incus config set <conta...
ここでは「raw.idmap」を使います
ホストのアカウント「incus-supervisor」を作成したので既存...
#code(nonumber){{
[root@rockylinux9 ~]# cat /etc/subuid
saber:100000:65536
incus-supervisor:165536:65536
[root@rockylinux9 ~]# cat /etc/subgid
saber:100000:65536
incus-supervisor:165536:65536
[root@rockylinux9 ~]#
}}
incusデーモンもこのsubuidを使うのでincus-supervisorの末尾...
#code(nonumber){{
[root@rockylinux9 ~]# echo "root:231072:65536" >> /etc/su...
[root@rockylinux9 ~]# echo "root:231072:65536" >> /etc/su...
[root@rockylinux9 ~]# systemctl restart incus # 構成が変...
}}
これはコンテナ内のUID:0が、ホスト側ではUID:165536に該当し...
&size(10){なのでnfs側で 65536 より大きいUID/GIDの場合はこ...
***コンテナの作成 [#y2d3cf6a]
コンテナを作成する際にprofileが読み込まれ作られます。初め...
#code(nonumber){{
[incus-supervisor@rockylinux9 ~]$ incus profile list
To start your first container, try: incus launch images:u...
Or for a virtual machine: incus launch images:ubuntu/22.0...
+---------+-----------------------+---------+
| NAME | DESCRIPTION | USED BY |
+---------+-----------------------+---------+
| default | Default Incus profile | 0 |
+---------+-----------------------+---------+
[incus-supervisor@rockylinux9 ~]$ incus profile show defa...
config: {}
description: Default Incus profile
devices:
root:
path: /
pool: default
type: disk
name: default
used_by: []
project: default
[incus-supervisor@rockylinux9 ~]$
}}
現在profileは1つあって、「default」という名称。中身はnic...
では「cs1」というrockylinux9なコンテナを作ってみます
#code(nonumber){{
[incus-supervisor@rockylinux9 ~]$ incus launch images:roc...
Launching cs1
The instance you are starting doesn't have any network at...
To create a new network, use: incus network create
To attach a network to an instance, use: incus network ...
[incus-supervisor@rockylinux9 ~]$
[incus-supervisor@rockylinux9 ~]$ incus list
+------+---------+------+------+-----------+-----------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
+------+---------+------+------+-----------+-----------+
| cs1 | RUNNING | | | CONTAINER | 0 |
+------+---------+------+------+-----------+-----------+
[incus-supervisor@rockylinux9 ~]$
}}
っとコンテナ cs1 が出来ました
これでnicを付けて、ipを振ります
#code(nonumber){{
incus config device add cs1 eth0 nic nictype=bridged pare...
incus exec cs1 -- ip addr add 192.168.0.230/24 dev eth0
incus exec cs1 -- ip link set eth0 up
incus exec cs1 -- ip route add default via 192.168.0.1
incus exec cs1 -- sh -c 'echo "nameserver 192.168.0.1" > ...
}}
とコンテナの環境整備を行って、この段階で外部からパッケー...
#code(nonumber){{
incus exec cs1 -- bash
dnf install bind-utils NetworkManager-tui openssh-server
vi /etc/ssh/sshd_config
systemctl enable sshd --now
passwd root
systemctl start NetworkManager --now
nmtui
groupadd -g 1000 gfo
useradd -u 1000 -g 1000 -d /home/saber -s /bin/bash -m ...
}}
ページ名:
1