LXD 3.3 リリースのお知らせ¶
27th of July 2018
はじめに ¶
LXD チームは LXD 3.3 のリリースを発表することにとてもワクワクしています!
このリリースはどちらかというと機能を詰め込んだリリースです。この機能には、proxy
デバイスの重要な改良、lxc-to-lxd
の完全な書き換え、コンテナの削除からの保護、デバッグ・プロファイリング能力の改良、ネットワーク管理のいくつかの改良、たくさんの新しい CLI オプションを含みます。
通常のリリースと同様にバグフィックスも含みます。
新機能 ¶
lxc-to-lxd
の書き換えと改良 ¶
LXC から LXD へのマイグレーションツールを、我々のコードの他の部分と同じように Go で書き直しました。
このツールは LXD のマイグレーション API を使い、(lxd-p2c
と同様に)コンテナを転送します。そして、LXC 2.x と 3.x の両方をサポートします。
ネットワークステート API ¶
/1.0/networks/<NAME>/state
という新しい API を追加しました。この API は既存のネットワークに関する情報を返します。例えば次のような出力が得られます:
{ "addresses": [ { "address": "10.166.11.1", "family": "inet", "netmask": "24", "scope": "global" }, { "address": "2001:470:b368:4242::1", "family": "inet6", "netmask": "64", "scope": "global" }, { "address": "fe80::4865:17ff:fed5:e347", "family": "inet6", "netmask": "64", "scope": "link" } ], "counters": { "bytes_received": 45866443, "bytes_sent": 3087152218, "packets_received": 600757, "packets_sent": 772253 }, "hwaddr": "fe:65:0e:c3:df:3d", "mtu": 1500, "state": "up", "type": "broadcast" }
コマンドラインクライアントには次のような問い合わせを行うサブコマンドが追加されました:
stgraber@castiana:~$ lxc network info lxdbr0 Name: lxdbr0 MAC address: fe:65:0e:c3:df:3d MTU: 1500 State: up Ips: inet 10.166.11.1 inet6 2001:470:b368:4242::1 inet6 fe80::4865:17ff:fed5:e347 Network usage: Bytes received: 45.87MB Bytes sent: 3.09GB Packets received: 600756 Packets sent: 772248
コンテナ削除に対する保護 ¶
新しい設定項目 security.protection.delete
を、コンテナに対して true
に設定できるようになりました。これにより、予想外の削除からコンテナを保護できます。
この機能は次のように使えます:
stgraber@castiana:~$ lxc config set c1 security.protection.delete true stgraber@castiana:~$ lxc delete c1 Error: Container is protected stgraber@castiana:~$ lxc config unset c1 security.protection.delete stgraber@castiana:~$ lxc delete c1
proxy
デバイスタイプに対する新しい設定オプション ¶
このリリースでは、proxy
デバイスに重要な改良をいくつか追加しました。
次のような新しいプロパティで、リスン用の UNIX ソケットの所有権とパーミッションをコントロールできます:
- uid
- gid
- mode
同様に proxy プロセス自身の特権削除のコントロールには次のプロパティを使います:
- security.uid
- security.gid
proxy は、proxy_protocol
を true
に設定することで TCP 接続に対して、HAProxy 互換の PROXY ヘッダ(V1)も設定できます。
そして最後に、nat
プロパティを true
に設定することで、proxy プロセスを完全にスキップして、代わりに NAT を使えます。これが動作するには、接続の両端が UDP か TCP 接続でなければならず、静的な IP アドレスを ipv4.address
もしくは ipv6.address
プロパティを使って、nic
デバイスに設定しなければいけません。
ホスト経由のイメージダウンロード ¶
LXD 3.2 で新しい devlxd API を導入しました。これは、security.devlxd
が有効で(デフォルト値です)、security.devlxd.images
が true
に設定されている場合は、コンテナ内の LXD デーモンから、公開もしくはキャッシュされたイメージをダウンロードできるという機能でした。
LXD 3.3 では、自身がその新しい API を使うことをサポートし、ネットワークを使う前にホストからイメージを取得しようとします。これにより、ネストした LXD のユーザが帯域を大幅に節約できます。
ビルトインのデバッグとプロファイリングサーバ ¶
LXD は pprof サーバをビルトインするようになりました。core.https_address
と同様の文法で core.debug_address
プロパティを設定することで、この機能を有効にできます。
そして http://<address>/debug/pprof
にアクセスし、LXD デーモンの基本的な情報をいくつか取得できます。より詳細な情報を取り出すために、pprof
ツールから同じ URL を使えます。
lxc network list
の --format
オプション ¶
この新しいオプションは、他の色々なサブコマンドと同様に使えます。そして、出力として table
、csv
、json
、yaml
で出力を取得できます。
コピー、移動中のデバイス設定の上書き ¶
-d <device>,<key>=<value>
を lxc copy
、lxc move
に指定することで、リモートコピー、移動操作中に、指定したデバイスの設定を上書きできます。
lxd init
コマンドの --dump
オプション ¶
LXD には lxd init --preseed
を使って、あらかじめ準備した設定を流し込む機能があります。これまでは、このあらかじめ準備する設定の定義は、手書きで書くか、lxd init
をインタラクティブに実行した最後に取得するしかありませんでした。
新たに lxd init --dump
コマンドで、実行中の LXD の設定から設定ファイルを生成できるようになりました。これで、ほぼ同一の設定の新しい LXD サーバをより簡単に設定できます。
LXD のネットワークの bridge.hwaddr
プロパティ ¶
ネットワークに新たに追加された bridge.hwaddr
プロパティを設定し、LXD ブリッジの MAC アドレスを制御できます。この機能は、モニタリング・グラフ化しているシステムや、常に変化する MAC アドレスが問題を引き起こしていたようなシステムに対して有効です。
LXD ネットワークの ipv4.nat.order
と ipv6.nat.order
プロパティ ¶
このふたつのオプションは、ファイアウォールに NAT ルールを追加する際の順番を制御します。
デフォルトでは before
が設定されます。これは生成したルールが既存のユーザルールの前に追加されることを意味します。代わりに after
を設定すると、マニュアルで追加するファイアウォールルールを LXD 自身のルールの直前に実行する必要がある場合に便利です。
Bugs fixed¶
- client: Export OperationWait
- client: Split LXD download code into own function
- doc: Document hostname requirements
- doc: Fix links in api-extension
- doc: Fix missing escaping in api-extensions
- doc: Fix "neighbour: ndisc_cache: neighbor table overflow"
- doc: Fix storage volume examples
- doc: Note that default profile cannot be deleted/renamed
- i18n: Update translations from weblate
- i18n: Update translation templates
- lxc: Be clever about when to show "lxd init"
- lxc: Switch to Ubuntu 18.04 as initial container
- lxc/cluster: Remove bad alias
- lxc/profile: Fix "get" command
- lxd: Fix StoragePoolVolumesGetNames
- lxd: Make iptables logic usable for containers
- lxd: Move command structs around
- lxd: Prevent renaming/deletion of the default profile
- lxd: Properly set containerArgs in all cases
- lxd/apparmor: Allow ro bind-mounts and remounts
- lxd/apparmor: Fix typo in nesting profile
- lxd/certificates: Log password failures
- lxd/cluster: Fix attaching CEPH custom volumes
- lxd/cluster: Only restart local containers
- lxd/cluster: Reduce the frequency of raft snapshots
- lxd/containers: adapt allowedUnprivilegedOnlyMap()
- lxd/containers: Allow identity mappings for unprivileged containers
- lxd/containers: Don't fail while parsing NVIDIA GPU list
- lxd/containers: Fix Nvidia minor index parsing
- lxd/containers: Fix removing NVIDIA containers
- lxd/containers: Handle cards among Nvidia devices
- lxd/containers: Special case passing all GPUs
- lxd/containers: use lxcSetConfigItem() for lxc.log.file
- lxd/containers: Validate proxy config early
- lxd/db: Don't hang after bad request
- lxd/db: Fix handling of NetworkConfigClear
- lxd/init: Allow selecting custom Fan underlay
- lxd/init: Fix typo in Fan question
- lxd/migration: Fix cross version migrations
- lxd/networks: Calculate Fan MTU based on parent
- lxd/networks: Fix PATCH operations
- lxd/networks: Fix port number for DHCPv6
- lxd/networks: Fix revert on update failure
- lxd/networks: Improve dnsmasq leases cleanup
- lxd/networks: Improve error on missing openvswitch
- lxd/networks: Skip DHCP mangle if firewall off
- lxd/networks: Support stateful DHCPv6 with prefixes longer than /64
- lxd/operations: Forward to right cluster node
- lxd/patches: Force a one-time config re-gen
- lxd/patches: Make config re-gen fault tollerant
- lxd/patches: Make lvm.thinpool_name and lvm.vg_name node-specific
- lxd/proxy: Convert mode from string to octal
- lxd/proxy: Handle full socket buffer
- lxd/storage: Allow deleting storage pools that only contain image volumes
- lxd/storage/btrfs: Fix recursive snapshots
- lxd/storage/ceph: Don't keep snapshots mounted
- lxd/storage/ceph: Mount the fs after growing the block
- lxd/storage: Drop late size check
- lxd/storage: Fix double quoting
- lxd/storage: Fix PATCH on storage pools
- lxd/storage: Fix volume creation API
- lxd/storage: Keep images when deleting pool
- lxd/storage/lvm: Fix umount logic during btrfs copy
- lxd/storage/lvm: Round size to closest 512 bytes
- lxd/storage: Remove image on pool deletion
- lxd/storage/zfs: Support querying version through modinfo
- shared: Dereference directory symlinks
- shared: Do not print writer struct on network error
- shared: Move parseNumberFromFile to shared
- shared/idmap: support skipping directories
- shared/util: Fix unit parsing (metric vs iec)
- tests: Add alternative TCP port finder
- tests: Add test for network put/patch
- tests: Fix race in network test
- tests: Fix static analysis
- tests: Perform a lazy umount in case of errors
- tests: Switch to MiB for btrfs resize
- tests: Test default profile renaming/deletion
Try it for yourself¶
This new LXD release is already available for you to try on our demo service.
Downloads¶
The release tarballs can be found on our download page.