4.0.2 kernel と非特権コンテナ
(2015-06-11 追記) 以下の問題は 4.0.5 カーネルで解決しています。
手元 (Plamo 5.3) では 4.0.2 カーネルで LXC の非特権コンテナを起動するとカーネルが固まります。その時のログは以下です (netconsole 経由で取ったので見にくい)。
4.0.2 でマージされたコミットのうち、以下を revert するとお亡くなりにはならなくなります (副作用は知りません)。
あまり関係する人はいないかもしれませんが、非特権コンテナを使う場合はとりあえず 4.0.1 までを使っておくのが良さそうです。
- mnt: Honor MNT_LOCKED when detaching mounts
- mnt: Fix the error check in __detach_mounts
- mnt: Update detach_mounts to leave mounts connected
とりあえず lxc-devel には「誰か同じような現象に遭遇した?」とメール投げてみましたが...
(2015-05-12 追記)
mainlineからstableへ適用すべきパッチが2つほど抜けていたようです。4.0.3 で直るのかな?
以下の 2 つのパッチを適用すると LXC 非特権コンテナが問題なく動作し、カーネルがハングアップする事もなくなります。
- mnt: Fail collect_mounts when applied to unmounted mounts
- fs_pin: Allow for the possibility that m_list or s_list go unused.
(2015-05-14 追記)
4.0.3 がリリースされていますが、上記のパッチは適用されていません。
(2015-05-18 追記)
4.0.4 がリリースされていますが、上記のパッチは適用されていません。
lxd を使ったライブマイグレーション (2)
このエントリの情報はおそらく古いです
前のエントリ はネットワークの設定なしで行いましたが、そこに veth でホストと通信可能なネットワークの設定を行って試しました。一度で書けよって内容ですが :-p
まず非特権コンテナで veth が使える設定を行います (多分必要)。LXC の設定です。/etc/lxc/lxc-usernet で "ubuntu" ユーザが 10 個 veth ペアを作成可能なようにしました (lxcbr0 を使用)。両方のホストで行っています。
$ cat /etc/lxc/lxc-usernet # USERNAME TYPE BRIDGE COUNT ubuntu veth lxcbr0 10
前のエントリ で作成した profile である "criu" にネットワーク設定を追加します。両方のホスト共変更します。
name: criu config: raw.lxc: | lxc.tty = 0 lxc.console = none lxc.cgroup.devices.deny = c 5:1 rwm security.privileged: "true" devices: eth0: nictype: bridged parent: lxcbr0 type: nic
これでコンテナを起動し、コンテナにアドレスを割り当てます。
$ lxc start ct01 $ lxc exec ct01 -- /sbin/dhclient eth0 $ lxc list +------+---------+-----------+------+ | NAME | STATE | IPV4 | IPV6 | +------+---------+-----------+------+ | ct01 | RUNNING | 10.0.3.77 | | +------+---------+-----------+------+
割り当たったのでマイグレーションします。
$ lxc move lxd01:ct01 lxd02:ct01 $ lxc list +------+-------+------+------+ | NAME | STATE | IPV4 | IPV6 | +------+-------+------+------+ +------+-------+------+------+ $ lxc list lxd02: +------+---------+-----------+------+ | NAME | STATE | IPV4 | IPV6 | +------+---------+-----------+------+ | ct01 | RUNNING | 10.0.3.77 | | +------+---------+-----------+------+
移動しましたね。
(追記)
lxd02 上で
$ lxc exec ct01 -- apt-get install micro-httpd $ lxc exec ct01 -- sh -c 'echo "LXD Test" | tee /var/www/index.html' $ curl http://10.0.3.77/ LXD Test
としておいて、lxd01 上で以下のように実行すると、ちゃんとマイグレーションされてますね。
$ lxc move lxd02:ct01 lxd01:ct01 $ curl http://10.0.3.77/ LXD Test
一度、まずマイグレーションした後である程度コンテナイメージが同期された状態で、特に何もファイルを更新しない状態でマイグレーションしてもそれなりにダウンタイムありますね。
(さらに追記) 1秒おきに date コマンドの結果を出力するスクリプトを回してマイグレーションするとこんなことも。結構時間かかりますね。それほどコンテナ上のファイルは (手では) 変更していません。
Wed Apr 15 10:06:12 UTC 2015 Wed Apr 15 10:06:13 UTC 2015 Wed Apr 15 10:07:31 UTC 2015 Wed Apr 15 10:07:32 UTC 2015
Wed Apr 15 10:09:53 UTC 2015 Wed Apr 15 10:09:54 UTC 2015 Wed Apr 15 10:10:14 UTC 2015 Wed Apr 15 10:10:15 UTC 2015
lxd を使ったライブマイグレーション (1)
このエントリの情報はおそらく古いです
先月、LXD 0.3 のリリースでライブマイグレーションサポート、というアナウンスがあったので早速試しましたが失敗しました (> lxd を使ったライブマイグレーション(未完) - TenForwardの日記)。
これはバグがあったようで、その後の LXD と LXC の更新で修正され、0.6 でとりあえず動くようになったようなので試してみました。とりあえずネットワークの設定がされないシンプルなコンテナで試しました。
LXD はまだまだリリースのたびにかなり機能が変わっていますし、LXC の C/R 関連のパッチもガンガン投稿されている状況ですし、CRIU もバージョンアップのたびに新機能が追加されていますので、以下の例がいつまで有効かわかりません。(明日には動かないかも?)
準備
まずは準備です。OS は Ubuntu Trusty をインストールした環境を 2 つ準備しています。
LXC/LXD のリポジトリは以下を登録します。
- LXD
- lxd-stable(最新のstableリリース)
- LXC
- lxc-git-stable-1.1(1.1系列の最新リリース)
以下の操作は両方のホストで行います。
$ sudo add-apt-repository ppa:ubuntu-lxc/lxd-stable $ sudo add-apt-repository ppa:ubuntu-lxc/lxc-git-stable-1.1 $ sudo apt-get update
LXDをインストールします。その後、依存関係で入る lxcfs を削除します。これは、現時点では lxcfs が行う bind mount を CRIU でサポートしていないためのようです。
$ sudo apt-get install lxd $ dpkg-query --show lxd lxd 0.6-0ubuntu1~ubuntu14.04.1~ppa1 $ dpkg-query --show lxc lxc 1.1.2+stable~20150415-0023-0ubuntu1~trusty $ sudo apt-get remove lxcfs
LXD 0.6, LXC 1.1.2 がインストールされています。
ここで lxd インストール時に管理者アカウント (sudo グループに所属だっけ?) は lxd グループに属するように設定されますので、一度ログアウトするなどして lxd グループに属した状態にします。
$ id uid=1000(ubuntu) gid=1000(ubuntu) groups=1000(ubuntu),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),110(lpadmin),111(sambashare),113(lxd)
各 LXD ホストのパスワードを設定しましょう。
$ lxc config set password hogehoge
LXD の設定
以下は lxc コマンドを実行するところで実行します。ここでは lxd01 で実行しています。
- イメージを準備します。linuxcontainers.org の Ubuntu イメージを使います。イメージのエイリアスとして "ubuntu" という名前を登録します。
$ lxd-images import lxc ubuntu trusty amd64 --alias ubuntu
Downloading the GPG key for https://images.linuxcontainers.org
Downloading the image list for https://images.linuxcontainers.org
Validating the GPG signature of /tmp/tmp5y_tj_h4/index.json.asc
Downloading the image: https://images.linuxcontainers.org/images/ubuntu/trusty/amd64/default/20150415_03:49/lxd.tar.xz
Validating the GPG signature of /tmp/tmp5y_tj_h4/ubuntu-trusty-amd64-default-20150415_03:49.tar.xz.asc
Image imported as: 45cd14361df508652160a28f76d96360a68e6c354e39879671b8b600a788562c
Setup alias: ubuntu - リモートホストの登録。現時点では自ホストも登録しておく必要があります。
$ lxc remote add lxd01 lxd01:8443
$ lxc remote add lxd02 lxd02:8443
$ lxc remote list
local
lxd01 https://lxd01:8443
lxd02 https://lxd02:8443 - デフォルトで登録されているprofileの"default"を適当な名前のプロファイルにコピーします。ここでは"criu"にしました。
$ lxc config profile copy default criu
- "criu"を編集します。
$ lxc config profile edit criu
- 内容はこんな風にします。
name: criu
config:
raw.lxc: |
lxc.tty = 0
lxc.console = none
lxc.cgroup.devices.deny = c 5:1 rwm
security.privileged: "true"
devices: {} - "raw.lxc"で設定されているものは、現時点でLXCでCRIUを使う場合に必須の設定です。
- 現時点で、非特権コンテナの C/R はできませんので "security.privileged" を "true" にします。これで特権コンテナで起動します。
- 内容はこんな風にします。
- マイグレーション元と先に同じ profile がなければマイグレーションできませんので lxd02 側にコピーします。
$ lxc config profile copy lxd01:criu lxd02:criu
$ lxc config profile list
default
criu
$ lxc config profile list lxd02:
default
criu
マイグレーション
- コンテナを作成します。イメージは "ubuntu" を使い、"ct01" という名前です。
$ lxc init ubuntu ct01
- 作成したコンテナに、先ほど作成した profile である "criu" を適用します。
$ lxc config profile apply ct01 criu
Profile criu applied to ct01 - コンテナを起動します。このコンテナは veth の設定もされない独立したネットワークにいるコンテナです。
$ lxc start ct01
$ lxc list
+------+---------+------+------+
| NAME | STATE | IPV4 | IPV6 |
+------+---------+------+------+
| ct01 | RUNNING | | |
+------+---------+------+------+ - マイグレーションします。
$ lxc move lxd01:ct01 lxd02:ct01
$ lxc list
+------+-------+------+------+
| NAME | STATE | IPV4 | IPV6 |
+------+-------+------+------+
+------+-------+------+------+
$ lxc list lxd02:
+------+---------+------+------+
| NAME | STATE | IPV4 | IPV6 |
+------+---------+------+------+
| ct01 | RUNNING | | |
+------+---------+------+------+
とりあえず lxd01 で動いていたコンテナが lxd02 に移動しました。
これだけではコンテナ上で動いているデーモン等がちゃんと移動したのかもわかりませんし、ダウンタイムも不明ですが、とりあえず移動したということで。
続編は こちら
lxd を使ったライブマイグレーション(未完)
(2015-04-15 追記) マイグレーションできたブログエントリを書きました > lxd を使ったライブマイグレーション (1) - TenForwardの日記
(2015-03-18 追記) lxd 0.4 が出たので試してますが、今度はマイグレーション先の lxd がこんなログを吐いてしまいます ^^;
panic: runtime error: invalid memory address or nil pointer dereference
(2015-03-18 追記ここまで)
前回、リリースされたばかりの lxd 0.3 を簡単に試してみました。本当に簡単なお試しで lxd である必要すらないお試しでした。もう少し lxd らしい使い方を、と思って試してますが、なかなかうまくいきませんね。
lxd 0.3 の目玉機能の一つはこれでしょう。
Initial support of live migration (requires particular container configuration)
https://linuxcontainers.org/lxd/news/
ライブマイグレーション!!
うまくいくか試してみました。ドキュメントがほとんどないので手探りです。
コンテナの特別な設定が必要とあります。これは lxd のバックエンドは liblxc を使っているので LXC 1.1 でも必要な設定と同じで以下の 3 つです。
lxc.tty=0 lxc.console=none lxc.cgroup.devices.deny=c 5:1 rwm
お試し環境
以下の 3 台を使っています。
lxd のインストール
前回と同じです。Ubuntu 14.04.2 LTS を使いました。2 台にセットアップします。
ubuntu@lxd01:~$ sudo add-apt-repository ppa:ubuntu-lxc/lxd-daily ubuntu@lxd01:~$ sudo apt-get update ubuntu@lxd01:~$ sudo apt-get install lxd
これでインストールされた /etc/init/lxd.conf を書き換えて、リモートから接続できるようにします。lxd.conf の exec 行を書き換えて以下のようにします。
exec /usr/bin/lxd --group lxd --tcp 10.200.200.200:8443 --debug >> /var/log/lxd.log 2>&1
'--debug' を付けて、デバッグ出力を /var/log/lxd.log に保存するようにしてみました。
クライアントの設定
lxc コマンドを実行するクライアントで remote の設定をします。
plamo@client:~$ export GOPATH=~/go plamo@client:~$ export PATH=$PATH:$GOPATH/bin plamo@client:~$ lxc remote add lxd01 10.200.200.200:8443 plamo@client:~$ lxc remote add lxd02 10.200.200.208:8443 plamo@client:~$ lxc remote list lxd01 <10.200.200.200:8443> lxd02 <10.200.200.208:8443>
イメージの登録
lxd ホスト上で以下のようにします。
ubuntu@lxd01:~$ lxd-images import lxc ubuntu trusty amd64 --alias ubuntu --alias ubuntu/trusty --alias ubuntu/trusty/amd64
クライアントから確認してみます。
plamo@client:~$ lxc image list lxd01: +--------+----------+--------+-------------+ | ALIAS | HASH | PUBLIC | DESCRIPTION | +--------+----------+--------+-------------+ | ubuntu | 47cd2f39 | no | | +--------+----------+--------+-------------+
コンテナ作成
片方のlxdホスト上でコンテナを作成します。
plamo@client:~$ lxc init ubuntu lxd01:trusty01
デフォルトでは作成したコンテナには "default" というプロファイルが割りあたっています。プロファイルはコンテナに対する設定をまとめたものです。"default" をコピーして "criu" という名前のプロファイルにします。
plamo@client:~$ lxc config profile copy lxd01:default lxd01:criu
"criu" プロファイルを編集します。以下のように edit コマンドを実行するとエディタが起動します。
plamo@client:~$ lxc config profile edit lxd01:criu (プロファイルの編集)
こんな感じにします(yaml形式)。config の所の raw.lxc を追加しました。
name: criu config: raw.lxc: |- lxc.tty=0 lxc.console=none lxc.cgroup.devices.deny=c 5:1 rwm devices: eth0: nictype: bridged parent: lxcbr0 type: nic
ちゃんと編集できたか確認します。
plamo@client:~$ lxc config profile show lxd01:criu (プロファイルの確認) raw.lxc = lxc.tty = 0 lxc.console = none lxc.cgroup.devices.deny = c 5:1 rwm eth0: nic
"criu" プロファイルをコンテナに割り当てます。
plamo@client:~$ lxc config profile apply lxd01:trusty01 criu Profile criu applied to trusty01
もう一台の lxd ホストにもプロファイルをコピーします。
plamo@client:~$ lxc config profile copy lxd01:criu lxd02:criu
プロファイルの確認
plamo@client:~$ lxc config profile list lxd01: default criu plamo@client:~$ lxc config profile list lxd02: default criu
コンテナの起動とマイグレーション
コンテナを起動します。
plamo@client:~$ lxc start lxd01:trusty01 plamo@client:~$ lxc list lxd01: +----------+---------+---------------------+------+ | NAME | STATE | IPV4 | IPV6 | +----------+---------+---------------------+------+ | trusty01 | RUNNING | 10.0.3.7, 127.0.0.1 | ::1 | +----------+---------+---------------------+------+
ライブマイグレーションを実行します。
$ lxc move lxd01:trusty01 lxd02:trusty01 error: restore failed
がーん。
コンテナの送り側 (lxd01) のログはこんな
2015/03/17 19:18:55 client cert != key for lxd01 2015/03/17 19:18:55 found cert for 10.200.200.200 2015/03/17 19:18:55 handling GET /1.0 2015/03/17 19:18:55 client cert != key for lxd01 2015/03/17 19:18:55 found cert for 10.200.200.200 2015/03/17 19:18:56 client cert != key for lxd01 2015/03/17 19:18:56 found cert for 10.200.200.200 2015/03/17 19:18:56 handling GET /1.0/containers/trusty01 2015/03/17 19:18:56 setting lxc.tty=0 2015/03/17 19:18:56 setting lxc.console=none 2015/03/17 19:18:56 setting lxc.cgroup.devices.deny=c 5:1 rwm 2015/03/17 19:18:56 Configured device eth0 2015/03/17 19:18:56 found cert for 10.200.200.200 2015/03/17 19:18:56 handling POST /1.0/containers/trusty01 2015/03/17 19:18:56 setting lxc.tty=0 2015/03/17 19:18:56 setting lxc.console=none 2015/03/17 19:18:56 setting lxc.cgroup.devices.deny=c 5:1 rwm 2015/03/17 19:18:56 Configured device eth0 2015/03/17 19:18:57 client cert != key for lxd01 2015/03/17 19:18:57 client cert != key for 10.200.200.200 2015/03/17 19:18:57 allowing untrusted GET to /1.0/operations/49bcae70-b968-4f14-886b-b5cb2280742c/websocket?secret=0h5i81aO9EXXfGHbTHm5eQXmB704mxX2%2BasWPYjEi0jL9Ykbdh1wzU635ylLE%2F3WbqJHplXBHlqM9tf8OrXIvpJBwRyhi4WrK2BCXwKJzwKRVt3hlqZNUPD02VHv%2B%2Bea4sgVDQ%3D%3D 2015/03/17 19:18:58 client cert != key for lxd01 2015/03/17 19:18:58 client cert != key for 10.200.200.200 2015/03/17 19:18:58 allowing untrusted GET to /1.0/operations/49bcae70-b968-4f14-886b-b5cb2280742c/websocket?secret=%2BAFr%2BL4Zt4mBciMWEciW0%2FOdHWSt14Ty13k%2Berz%2FC%2FKRF1LoGAZsnG7HBeuRgZMg8rEEG0oE2f5WfTrVKOZJnZd7cRtNaguiEYzwvwEly6fmplO9Nom37ti0v%2FSvNMbzZA3lDQ%3D%3D 2015/03/17 19:18:58 client cert != key for lxd01 2015/03/17 19:18:58 client cert != key for 10.200.200.200 2015/03/17 19:18:58 allowing untrusted GET to /1.0/operations/49bcae70-b968-4f14-886b-b5cb2280742c/websocket?secret=zOVPGshQorM8bm1IJk3Y9lVhXwz5oTkHSFbqH5yCZBSph2YOKEHpeqjrxj7BtESyq3iGabS993AHjzi8NG99A05z5OsL6EB2KGyx1%2Fb3sEDun%2B43TwzjGWYyiZbOcdYBvGxWaQ%3D%3D 2015/03/17 19:18:58 got error getting next reader websocket: close 1005 , &{{%!s(*net.netFD=&{{10 0 0} 16 1 1 false unix 0xc20811b300 0xc20811b320 {139997956048208}})}} 2015/03/17 19:19:15 got error getting next reader websocket: close 1005 , &{{%!s(*net.netFD=&{{10 0 0} 16 1 1 false unix 0xc20811a2a0 0xc20811a2e0 {139997956048384}})}}
受け側 (lxd02) のログはこんな
2015/03/17 19:18:56 client cert != key for lxd02 2015/03/17 19:18:56 found cert for 10.200.200.208 2015/03/17 19:18:56 handling GET /1.0 2015/03/17 19:18:56 client cert != key for lxd02 2015/03/17 19:18:56 found cert for 10.200.200.208 2015/03/17 19:18:56 found cert for 10.200.200.208 2015/03/17 19:18:56 handling GET /1.0/profiles 2015/03/17 19:18:56 responding to profiles get 2015/03/17 19:18:56 client cert != key for lxd02 2015/03/17 19:18:56 found cert for 10.200.200.208 2015/03/17 19:18:56 handling POST /1.0/containers 2015/03/17 19:18:56 responding to create 2015/03/17 19:18:57 setting lxc.tty=0 2015/03/17 19:18:57 setting lxc.console=none 2015/03/17 19:18:57 setting lxc.cgroup.devices.deny=c 5:1 rwm 2015/03/17 19:18:57 Configured device eth0 2015/03/17 19:18:57 client cert != key for lxd02 2015/03/17 19:18:57 found cert for 10.200.200.208 2015/03/17 19:18:57 handling GET /1.0/operations/4aabada3-030d-4d6e-96b4-2625b070a180/wait 2015/03/17 19:18:58 got error getting next reader read tcp 10.200.200.200:8443: use of closed network connection, &{%!s(*os.File=&{0xc2080b2a50}) {{%!s(int32=0) %!s(uint32=0)} %!s(uint32=0)} ?reflect.Value?} 2015/03/17 19:19:15 got error getting next reader read tcp 10.200.200.200:8443: use of closed network connection, &{%!s(*os.File=&{0xc2080b23f0}) {{%!s(int32=0) %!s(uint32=0)} %!s(uint32=0)} ?reflect.Value?}
何か実行されてる風ですが、エラーが出てますね。(ホスト間で rsync は実行されてるっぽい)
識者の登場を待ちましょう :-p (続くかも)
10 分で試せる lxd 0.3
このエントリの情報は古いです
(2015/04/08 追記) ubuntu-lxc の PPA の構成が変わっていますので、以下の add-apt-repository コマンドの例はそのまま実行できません。PPA の詳細は公式ページでご確認ください。
前回 (その1、その2) lxd を試したことを書いてからまだ 1 ヶ月も経ってませんが、使い方がかなりがらっと変わった lxd 0.3 がリリースされていますので試してみました。0.2 からこんな感じだったようですが。
インストール
面倒なので Ubuntu 14.04.2 に lxd の PPA を追加してパッケージインストールしました。
ubuntu@lxd01:~$ sudo add-apt-repository ppa:ubuntu-lxc/lxd-daily ubuntu@lxd01:~$ sudo apt-get update ubuntu@lxd01:~$ sudo apt-get install lxd
ubuntu@lxd01:~$ dpkg -l lxd :(snip) ||/ Name Version Architecture Description +++-==============-============-============-================================= ii lxd 0.3-0ubuntu1 amd64 Container hypervisor based on LXC
必要な設定もされていますし lxd も起動しています。ここでは ubuntu ユーザで試してます。
- lxd デーモンは起動済み。"lxd" グループに属するユーザが lxd デーモンに接続できます。
ubuntu@lxd01:~$ ps ax | grep lxd
1085 ? Ssl 0:01 /usr/bin/lxd --group lxd
1179 ? Ss 0:00 /usr/bin/lxd --group lxd - "ubuntu" ユーザは手元では "sudo" グループに属しているので (という条件だったと思う)、自動的に "lxd" グループに所属してます
ubuntu@lxd01:~$ id
uid=1000(ubuntu) gid=1000(ubuntu) groups=1000(ubuntu),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),110(lpadmin),111(sambashare),113(lxd) - rootで非特権コンテナを動かすためにsubuid/subgidにrootが追加済み
ubuntu@lxd01:~$ cat /etc/subuid /etc/subgid
ubuntu:100000:65536
lxd:100000:65536
root:100000:65536
ubuntu:100000:65536
lxd:100000:65536
root:100000:65536
イメージの登録
lxd は自身に登録されたイメージからコンテナを作ります。lxd にイメージを登録するには、今の所(?) lxc 用のイメージをダウンロードしてきて変換するようです。lxc 用のイメージは images.linuxcontainers.org にあります。(lxc-create の download テンプレートが使うイメージ)
では、イメージを作りましょう(取得&変換&登録)。今の所 lxd-images というスクリプトがインストールされているのでそれを使います。Plamo 5.x の 64bit 版コンテナを使いましょう。イメージにエイリアスが付与できるようです (plamo, plamo/5.3, plamo/5.3/x86_64 という3つのエイリアスを付けた)。
ubuntu@lxd01:~$ lxd-images import lxc plamo 5.x amd64 --alias plamo --alias plamo/5.3 --alias plamo/5.3/x86_64 Downloading the GPG key for https://images.linuxcontainers.org Downloading the image list for https://images.linuxcontainers.org Validating the GPG signature of /tmp/tmp1dkupz2k/index.json.asc Downloading the image: https://images.linuxcontainers.org/images/plamo/5.x/amd64/default/20150310_21:36/lxd.tar.xz Validating the GPG signature of /tmp/tmp1dkupz2k/plamo-5.x-amd64-default-20150310_21:36.tar.xz.asc Image imported as: 58ea935fd2ce326279a97d711b6a7c50419a638db1423b5ba21c3496c55f0c04 Setup alias: plamo Setup alias: plamo/5.3 Setup alias: plamo/5.3/x86_64
イメージの確認
ubuntu@lxd01:~$ lxc image list +-------+----------+--------+-------------+ | ALIAS | HASH | PUBLIC | DESCRIPTION | +-------+----------+--------+-------------+ | plamo | 58ea935f | no | | +-------+----------+--------+-------------+
コンテナの作成と起動
イメージからコンテナを作成して起動します。"plamo" イメージから "plamo01" コンテナを作成して起動。
ubuntu@lxd01:~$ lxc launch plamo plamo01 Creating container...done Starting container...done
起動の確認。
ubuntu@lxd01:~$ lxc list +---------+---------+----------------------+------+ | NAME | STATE | IPV4 | IPV6 | +---------+---------+----------------------+------+ | plamo01 | RUNNING | 10.0.3.70, 127.0.0.1 | ::1 | +---------+---------+----------------------+------+ ubuntu@lxd01:~$ lxc info plamo01 Name: plamo01 Status: RUNNING Init: 1191 Ips: eth0: IPV4 10.0.3.70 lo: IPV4 127.0.0.1 lo: IPV6 ::1
コンテナ内でコマンドを実行してみましょう。これは前のエントリと同じです。
ubuntu@lxd01:~$ lxc exec plamo01 -- uname -a Linux LXC_NAME 3.13.0-46-generic #77-Ubuntu SMP Mon Mar 2 18:23:39 UTC 2015 x86_64 GNU/Linux ubuntu@lxd01:~$ lxc exec plamo01 -- lsb_release -a LSB Version: n/a Distributor ID: Plamo Description: Plamo Linux release 5.3.1 Release: 5.3.1 Codename: n/a