LXD 3.18 リリースのお知らせ¶
2nd of October 2019
はじめに ¶
LXD チームは、LXD 3.18 のリリースをお知らせすることにとてもワクワクしています!
このリリースには、今後の LXD リリースでコンテナと同時に仮想マシンをサポートするための実装に必要な多数の事前作業が含まれています。LXD 3.18 には、仮想マシンを扱えるように、多数の API の追加と Go クライアントと cli ツールへの変更が含まれています。
この変更のほとんどは、API と内部コードベース内の containers
を、コンテナと仮想マシンの両方を包含する、より一般的な instances
へゆっくり置き換えていくものです。
この作業の大部分は、現在の普通のユーザーには見えないものです。すべて完全に下位互換性をもたせるために行っており、古い API クライアントは通常通り動作し続けます。
すぐに使える改良点としては、このリリースでは、より多くのディスク情報を公開できるようにリソース API を拡張しました。また、イメージの有効期限を変更する機能を追加し、新しいクラスタリングのロールメカニズムに変更し、Fan ネットワークを使っている場合により多くの設定ができるようになりました。
Enjoy!
新機能 ¶
新しい /1.0/instances
エンドポイント ¶
仮想マシンサポートへの一環で、現在の /1.0/containers
API は /1.0/instances
API への置き換えを行い、コンテナと仮想マシンの両方を返すようにしました。この新しい API エンドポイントの構造は(従来と)同じで、以前のエンドポイントは新しいものの上にある単なるタイプのフィルターになっています(訳注: コンテナタイプのインスタンスのみを返すフィルター)。
一貫性を保つため、仮想マシンサポートの準備ができた際には、/1.0/virtual-machine
エンドポイントも提供します。これも同様に /1.0/instances
に対するタイプフィルターとし、仮想マシンのみを返すようにします。
この作業の一環として、Go クライアントパッケージも変更され、すべて /1.0/instances
エンドポイントに対する新しい関数が含まれるように変更されました。そして新しい API が使えるかどうかも検出し、古い LXD サーバーと通信する際には古い API にフォールバックします。
コマンドラインツール(lxc
)は、これらの新しい関数を使用するように更新されました。
VM イメージ保存のサポート ¶
LXD のこのバージョンのリリースで、既に仮想マシンイメージが利用可能になっている他の LXD サーバーや simplestream サーバーの仮想マシンイメージを検索できるようになりました。
現時点で、このようなイメージを持つサーバはふたつだけで ubuntu:
と ubuntu-daily:
です。
stgraber@castiana:~$ lxc image list ubuntu: serial=20190918 release=bionic architecture=amd64 +-------------+--------------+--------+---------------------------------------------+--------+-----------------+----------+-------------------------------+ | ALIAS | FINGERPRINT | PUBLIC | DESCRIPTION | ARCH | TYPE | SIZE | UPLOAD DATE | +-------------+--------------+--------+---------------------------------------------+--------+-----------------+----------+-------------------------------+ | b (11 more) | 8d1e0577b1d1 | yes | ubuntu 18.04 LTS amd64 (release) (20190918) | x86_64 | VIRTUAL-MACHINE | 328.25MB | Sep 18, 2019 at 12:00am (UTC) | +-------------+--------------+--------+---------------------------------------------+--------+-----------------+----------+-------------------------------+ | b (11 more) | 9ff5784302bf | yes | ubuntu 18.04 LTS amd64 (release) (20190918) | x86_64 | CONTAINER | 177.98MB | Sep 18, 2019 at 12:00am (UTC) | +-------------+--------------+--------+---------------------------------------------+--------+-----------------+----------+-------------------------------+ | | be760b6a51a0 | yes | ubuntu 18.04 LTS amd64 (release) (20190918) | x86_64 | CONTAINER | 141.19MB | Sep 18, 2019 at 12:00am (UTC) | +-------------+--------------+--------+---------------------------------------------+--------+-----------------+----------+-------------------------------+
上の例で、3 つの同じバージョンのイメージがあります。最初のイメージは qcow2 の仮想マシンイメージ、ふたつめは squashfs 形式のコンテナイメージ、3 つめは tar.xz 形式のコンテナイメージです。
VM イメージをローカルの LXD サーバーにコピーできます:
stgraber@castiana:~$ lxc image copy ubuntu:b local: --vm --alias b-vm Image copied successfully! stgraber@castiana:~$ lxc image list +-------+--------------+--------+---------------------------------------------+--------+-----------------+----------+-----------------------------+ | ALIAS | FINGERPRINT | PUBLIC | DESCRIPTION | ARCH | TYPE | SIZE | UPLOAD DATE | +-------+--------------+--------+---------------------------------------------+--------+-----------------+----------+-----------------------------+ | b-vm | 8d1e0577b1d1 | no | ubuntu 18.04 LTS amd64 (release) (20190918) | x86_64 | VIRTUAL-MACHINE | 328.25MB | Oct 2, 2019 at 8:22pm (UTC) | +-------+--------------+--------+---------------------------------------------+--------+-----------------+----------+-----------------------------+ | | 0c3ce5efa22e | no | Ubuntu bionic amd64 (20191002_07:42) | x86_64 | CONTAINER | 93.79MB | Oct 2, 2019 at 5:51pm (UTC) | +-------+--------------+--------+---------------------------------------------+--------+-----------------+----------+-----------------------------+
ここで紹介した機能はすでに動作していますが、LXD で仮想マシンが実行できなければ、現時点ではこの機能が特別役に立つとは思っていません。
より多くのディスクリソース情報の提供 ¶
/1.0/resources
API の storage
セクションが拡張され、ディスクのさまざまな情報を提供できるようになりました。次のような情報を含みます:
- ファームウェアバージョン
- デバイスパス
- シリアルナンバー
- RPM
- より詳細な
type
、CD-ROM ドライブの検出を含みます
システム上の色々なドライブ情報の出力例です:
root@lantea:~# lxc query /1.0/resources | jq .storage { "disks": [ { "block_size": 512, "device": "8:0", "device_path": "pci-0000:05:00.0-sas-phy0-lun-0", "firmware_version": "05.00K05", "id": "sda", "model": "WDC WD1001FALS-0", "numa_node": 0, "partitions": [], "read_only": false, "removable": false, "rpm": 7200, "serial": "WD-WMATV0861474", "size": 1000204886016, "type": "sata" }, { "block_size": 512, "device": "8:16", "device_path": "pci-0000:05:00.0-sas-phy1-lun-0", "firmware_version": "05.00K05", "id": "sdb", "model": "WDC WD1001FALS-0", "numa_node": 0, "partitions": [], "read_only": false, "removable": false, "rpm": 7200, "serial": "WD-WMATV0724608", "size": 1000204886016, "type": "sata" }, { "block_size": 512, "device": "8:32", "device_path": "pci-0000:05:00.0-sas-phy2-lun-0", "firmware_version": "CC45", "id": "sdc", "model": "ST33000651AS", "numa_node": 0, "partitions": [], "read_only": false, "removable": false, "rpm": 7200, "serial": "Z2912RXB", "size": 3000592982016, "type": "sata" }, { "block_size": 4096, "device": "8:48", "device_path": "pci-0000:05:00.0-sas-phy3-lun-0", "firmware_version": "CC27", "id": "sdd", "model": "ST3000DM001-1CH1", "numa_node": 0, "partitions": [], "read_only": false, "removable": false, "rpm": 7200, "serial": "W1F46QP2", "size": 3000592982016, "type": "sata" }, { "block_size": 512, "device": "8:64", "device_path": "pci-0000:00:1f.2-ata-1", "firmware_version": "EXT0CB6Q", "id": "sde", "model": "Samsung SSD 840", "numa_node": 0, "partitions": [], "read_only": false, "removable": false, "rpm": 0, "serial": "S1D5NSCF560605W", "size": 120034123776, "type": "sata" }, { "block_size": 512, "device": "8:80", "device_path": "pci-0000:00:1f.2-ata-2", "firmware_version": "300i", "id": "sdf", "model": "INTEL SSDSC2CT12", "numa_node": 0, "partitions": [ { "device": "8:81", "id": "sdf1", "partition": 1, "read_only": false, "size": 120033058304 } ], "read_only": false, "removable": false, "rpm": 0, "serial": "CVMP213200L8120BGN", "size": 120034123776, "type": "sata" }, { "block_size": 0, "device": "11:0", "device_path": "pci-0000:00:1f.2-ata-3", "firmware_version": "C108", "id": "sr0", "model": "DVD+-RW GSA-H73N", "numa_node": 0, "partitions": [], "read_only": false, "removable": true, "rpm": 0, "size": 1073741312, "type": "cdrom" } ], "total": 8 }
イメージ有効期限の変更 ¶
Austin の The University of Texas の学生からのコントリビューションにより、LXD イメージストア内のイメージの有効期限を編集できるようになりました。
この機能は lxc image edit
コマンドから使え、expires_at
のタイムスタンプを変更します。
クラスタリングロール ¶
将来的なクラスタリングの作業に備えて、クラスターメンバーのロールをレポートする新しい方法を追加しました。これはメンバーに直接与えられているロールのリストです。現在サポートされている唯一のロールは database
であり、クラスターメンバーがデータベースサーバのひとつであることを示しています。
root@lantea:~# lxc cluster show lantea server_name: lantea url: https://[2001:470:b0f8:1016:d250:99ff:fec2:9263]:8443 database: true status: Online message: fully operational roles: - database
この機能は、まもなくふたつの新しいロールの基盤として使われます:
eventhub¶
このロールに属するクラスターメンバーは、他のクラスターメンバーからのイベントを受け取ります。そして、他のイベントハブにイベントを同期します。これにより、各クラスターメンバーが他のすべてのクラスターメンバーに通知するという現在のイベント処理のアプローチが置き換えられます。イベント送信時の CPU 使用率と帯域幅を削減できるでしょう。
database_standby¶
このロールに属するクラスターメンバーは、通常のデータベースメンバーと同様に、ライブデータベースストリームを受け取ります。通常のデータベースメンバーとの違いは、Raft コンセンサスアルゴリズム(分散合意アルゴリズム)の投票メンバーにはならないことです。つまり、データベーストランザクションのコミットに必要な時間を増加させることなく、このようなメンバーを増やせるということです。
このようなスタンバイデータベースノードは、非常にすばやく投票メンバーに昇格できるので、クラスターの耐障害性を増加させ、クラスターデータベースの停止リスクなしでローリングアップデートのようなメンテナンス作業ができるようになります。
Fan モードでの IPv4 設定 ¶
Fan モードのネットワークで次の項目が設定できるようになりました:
- ipv4.dhcp.expiry
- ipv4.firewall
- ipv4.nat
- ipv4.nat.order
バグ修正(翻訳なし) ¶
- api: Add instances extension
- client: Rename ContainerServer to InstanceServer
- client/interfaces: Populate InstanceServer with rest of functions
- client/instances: Add instance related functions
- doc: Initial Github code of conduct
- doc: Initial Github security policy
- doc: Update remaining reference to readthedocs
- doc/index: Point to https://linuxcontainers.org/lxd/docs/master/
- doc/storage: Typo and example fix
- i18n: Update translations from weblate
- i18n: Update translation templates
- lxc: Don't print first-use on init/launch
- lxc: Switch cli tool to use InstanceServer
- lxc: Switch to using client Instance functions
- lxc/exec: Fix usage for --cwd
- lxc/remote: Trailing space in translatable string
- lxd: Add instance interface
- lxd: Add instance-type query param filter to LXD API
- lxd: Add support for InstanceOnly in API requests
- lxd: Add type field to instance API output
- lxd: Make import alias of device config package consistent throughout codebase
- lxd: Migrate storage references to container interface to instance interface
- lxd: Move events to new events package
- lxd: Move operations to its own package
- lxd: Move response to its own package
- lxd: Remove unix cred functions/types and updates usage to ucred package
- lxd: Rename containerLoadByID to instanceLoadById and returns Instance type
- lxd: Rename containerLoadByProjectAndName to instanceLoadByProjectAndName
- lxd: Rename containerLoadNodeAll to instanceLoadNodeAll
- lxd: Rename use of instance package to instancetype package
- lxd: Replace CType with instance.Type
- lxd: Require "ip" be installed
- lxd: Switch over to Instance types
- lxd: Switch to new event structure
- lxd: Update to use seccomp package
- lxd: Update usage of ContainerArgs to InstanceArgs
- lxd: Update usage of ContainerBackupArgs to InstanceBackupArgs
- lxd: Update use of device.Instance interface
- lxd: Update use of ForwardedResponseIfContainerIsRemote to supply instanceType
- lxd: Update use of string instance.Type to int type
- lxd/api: Constructs endpoint alias routes
- lxd/api: Rename container endpoint vars to instance prefix
- lxd/apparmor: Move apparmor into its own package
- lxd/backup: Change container field to instance type
- lxd/cluster/connect: Add instanceType filter to ConnectIfContainerIsRemote
- lxd/cluster/upgrade: Prevent crash if heartbeat occurs before dqlite init
- lxd/config: Allow modifying cluster.https_address
- lxd/containers: Embed the Instance interface into the container interface
- lxd/containers: Remove lxcSupportSeccompNotify
- lxd/containers: Update use of apparmor package
- lxd/containers: Fix comment
- lxd/containers: Migrate container_lxc to use operationlock package
- lxd/containers: Respect raw.lxc on stop/shutdown
- lxd/containers: Tighten directory ownership
- lxd/containers: Update containerLoadNodeProjectAll to support Type filtering
- lxd/containers: Validate POST instance type field and stores in DB
- lxd/daemon: Add Name and Aliases support to APIEndpoint
- lxd/daemon: Fix logging events
- lxd/daemon: Update to use seccomp package
- lxd/db: Band aid for https://github.com/canonical/dqlite/issues/163
- lxd/db: Flush any leftover operation on startup
- lxd/db: Use consts for cluster roles
- lxd/db/containers: Add db:ignore tag to Instance.Snapshot field
- lxd/db/containers: Add instanceType filter to ContainerNodeAddress
- lxd/db/containers: Fix tests
- lxd/db/containers: Remove ContainerType, CTypeRegular and CTypeSnapshot
- lxd/db/containers: Rename ContainerArgs to InstanceArgs
- lxd/db/containers: Rename ContainerBackupArgs to InstanceBackupArgs
- lxd/db/containers: Update container filtering functions for instance.Type
- lxd/db/instances: Re-run db generate
- lxd/db/instances: Update InstanceList to use instance.TypeAny
- lxd/devices: Allow uppercase in MACs
- lxd/devices: Update instance interface inline with others
- lxd/devices/disk: Properly return error messages
- lxd/devices/network: Fix typo in comment
- lxd/devices/nic: Set MTU on both side of veth
- lxd/devlxd: Fix handling of projects
- lxd/dnsmasq: Support uppercase MACs in UpdateStaticEntry
- lxd/events: Support multiple servers
- lxd/images: Fix image type during refresh
- lxd/images: Tweak wrapping
- lxd/images: Use native tar parser for metadata
- lxd/main_forkdns: Don't setup event logger
- lxd/main_init: Properly handle ceph/cephfs
- lxd/instance: Add functions to convert to/from instance.Type and string
- lxd/instance: Change instance types to own int type
- lxd/instance: Add operationlock package
- lxd/instance: Rename instance to instancetype
- lxd/instance: Use API instance types for string comparison
- lxd/networks: Allow ipv6.dhcp=true with ipv6.firewall=false
- lxd/networks: Properly return error messages
- lxd/networks: Reduce calls to iptables clear
- lxd/networks: Split functions and pass oldConfig
- lxd/operations: Fix operation events
- lxd/operations: Use state struct
- lxd/patches: Properly return error messages
- lxd/resources: Implement NVIDIA device fallback
- lxd/response: Add instanceType filter to ForwardedResponseIfContainerIsRemote
- lxd/seccomp: Add seccomp package
- lxd/state: Carry event server instances
- lxd/storage: Consistent error messages
- lxd/storage/btrfs: Fix bug with BTRFS snapshot copy
- lxd/storage/btrfs: Properly return error messages
- lxd/storage/ceph: Fix volume snapshot handling
- lxd/storage/cephfs: Fix querying volume on cluster
- lxd/storage/dir: Don't hide error message
- lxd/storage/lvm: Properly return error messages
- lxd/storage/zfs: Better handle broken images
- lxd/storage/zfs: Fix error handling in ImageCreate
- lxd/storage/zfs: Tweak destroy logic
- lxd/ucred: Add ucred package for ucred functions and types
- shared: Use Lchown when copying symlinks
- shared/api: Add new instance types
- shared/api: Add InstanceOnly field to InstancePost and InstanceSource
- shared/api: Location field of Event as omitempty
- shared/api: Make some NVIDIA fields omitempty
- shared/generate: Add support for
db:"ignore"
tag on fields - shared/generate: Re-run update-schema
- shared/generate: Support instance.Type
- shared/netutils: Update NetnsGetifaddrs to use Instance types
- tests: Add apparmor to static analysis
- tests: Add events package to static analysis test
- tests: Add operations package to static analysis
- tests: Add response package to static analysis
- tests: Add seccomp package to static analysis
- tests: Add unixcred to static analysis
- tests: Fix static analysis for ucred package
- tests: Switch to instance.Type
- tests: Tunes ZFS quota tests after intermittent failures
- tests: Update devlxd tests to use ucred package
- tests: Update security test
試用環境 ¶
この新しい LXD リリースは私たちの デモサービス で利用できます。
ダウンロード ¶
このリリースの tarball は ダウンロードページ から取得できます。
ビルド済みバイナリーは次のように使えます:
- Linux: snap install lxd
- MacOS: brew install lxc
- Windows: choco install lxc