<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>Boy, - grab a coffee :) and google while your servers are
working..<br>
here was a similar question..
<a class="moz-txt-link-freetext" href="https://lists.linuxcontainers.org/pipermail/lxc-users/2016-January/010899.html">https://lists.linuxcontainers.org/pipermail/lxc-users/2016-January/010899.html</a><br>
-Ingo<br>
</p>
<br>
<div class="moz-cite-prefix">Am 10.11.2016 um 22:46 schrieb Andriy
Tovstik:<br>
</div>
<blockquote
cite="mid:CABqniEY9vJnXr-8HjeHYdBc1UvNmQ=7k0cEthGmc70NcEpFhCQ@mail.gmail.com"
type="cite">
<div dir="ltr">Yep!
<div>nice idea, boys! moreover i can use -r switch with jq. But
unfortunately your solution can't execute tasks in parallel ;)</div>
<div><br>
<div class="gmail_quote">
<div dir="ltr">чт, 10 нояб. 2016 г. в 19:33, Ingo Baab <<a
moz-do-not-send="true" href="mailto:ib@baab.de">ib@baab.de</a>>:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000" class="gmail_msg">
<p class="gmail_msg">Andriy, (meanwhile) you can help
yourself with (doing that sequentially)..<br
class="gmail_msg">
<br class="gmail_msg">
<tt class="gmail_msg">for container in `lxc list
mysql-rep --format=json | jq .[].name | tr -d '"'`;
do lxc exec $container -- apt update; done</tt><br
class="gmail_msg">
</p>
</div>
<div bgcolor="#FFFFFF" text="#000000" class="gmail_msg">
<p class="gmail_msg">-Ingo</p>
</div>
<div bgcolor="#FFFFFF" text="#000000" class="gmail_msg">
<p class="gmail_msg"><br class="gmail_msg">
</p>
<div class="m_-4332737391318974087moz-cite-prefix
gmail_msg">Am 10.11.2016 um 15:36 schrieb Andriy
Tovstik:<br class="gmail_msg">
</div>
<blockquote type="cite" class="gmail_msg">
<div dir="ltr" class="gmail_msg">Thanks, Stéphane, i'm
very inattentive... Now it looks better. Additional
output format seems to be more comfortable than
additional tools. But it insignificantly.
<div class="gmail_msg"><br class="gmail_msg">
</div>
<div class="gmail_msg">And what do you think about
the second question about ability to run commands
on multiplie containers simultaneously using
regexps as container name ? Is this feature looks
useful?</div>
<div class="gmail_msg"><br class="gmail_msg">
</div>
<div class="gmail_msg"><br class="gmail_msg">
</div>
<div class="gmail_msg">
<div class="gmail_quote gmail_msg">
<div dir="ltr" class="gmail_msg">чт, 10 нояб.
2016 г. в 15:25, Stéphane Graber <<a
moz-do-not-send="true"
href="mailto:stgraber@ubuntu.com"
class="gmail_msg" target="_blank">stgraber@ubuntu.com</a>>:<br
class="gmail_msg">
</div>
<blockquote class="gmail_quote gmail_msg"
style="margin:0 0 0 .8ex;border-left:1px #ccc
solid;padding-left:1ex">stgraber@castiana:~$
lxc list --format=json | jq .[].name<br
class="gmail_msg">
"android"<br class="gmail_msg">
"lxd"<br class="gmail_msg">
"snapcraft"<br class="gmail_msg">
"test"<br class="gmail_msg">
"ubuntu-core"<br class="gmail_msg">
"ubuntu-zesty"<br class="gmail_msg">
"xen"<br class="gmail_msg">
"yak"<br class="gmail_msg">
<br class="gmail_msg">
On Thu, Nov 10, 2016 at 12:31:01PM +0000,
Andriy Tovstik wrote:<br class="gmail_msg">
> Hi, Janjaap Bos!<br class="gmail_msg">
><br class="gmail_msg">
> I tried jq. But as i have already wrote,
some useful fileds like container<br
class="gmail_msg">
> name are missing in json output...<br
class="gmail_msg">
><br class="gmail_msg">
> чт, 10 нояб. 2016 г. в 14:27, Janjaap Bos
<<a moz-do-not-send="true"
href="mailto:janjaapbos@gmail.com"
class="gmail_msg" target="_blank">janjaapbos@gmail.com</a>>:<br
class="gmail_msg">
><br class="gmail_msg">
> > You can pipe the json through jq.<br
class="gmail_msg">
> ><br class="gmail_msg">
> > See: <a moz-do-not-send="true"
href="https://stedolan.github.io/jq/tutorial"
rel="noreferrer" class="gmail_msg"
target="_blank">https://stedolan.github.io/jq/tutorial</a><br
class="gmail_msg">
> ><br class="gmail_msg">
> ><br class="gmail_msg">
> > 2016-11-10 11:17 GMT+01:00 Andriy
Tovstik <<a moz-do-not-send="true"
href="mailto:andriy.tovstik@gmail.com"
class="gmail_msg" target="_blank">andriy.tovstik@gmail.com</a>>:<br
class="gmail_msg">
> ><br class="gmail_msg">
> > Hi all!<br class="gmail_msg">
> ><br class="gmail_msg">
> > During LXD learning i encountered
with lack of some features.<br
class="gmail_msg">
> ><br class="gmail_msg">
> > The first one is "raw" output format
of lxc list. Currently lxc list<br
class="gmail_msg">
> > supports two formats: table and
json. Unfortunately both formats are<br
class="gmail_msg">
> > unusable for scripting.<br
class="gmail_msg">
> > It is very difficult to pass to
script output likes:<br class="gmail_msg">
> > # lxc list --format table -c n<br
class="gmail_msg">
> > +------------+<br class="gmail_msg">
> > | NAME |<br class="gmail_msg">
> > +------------+<br class="gmail_msg">
> > | mysql-rep1 |<br class="gmail_msg">
> > +------------+<br class="gmail_msg">
> > | mysql-rep2 |<br class="gmail_msg">
> > +------------+<br class="gmail_msg">
> > | mysql-rep3 |<br class="gmail_msg">
> > +------------+<br class="gmail_msg">
> ><br class="gmail_msg">
> > When i try to use json format i see
that useful fields like container name<br
class="gmail_msg">
> > are missing in output. May be it
will be useful to implement feature like:<br
class="gmail_msg">
> ><br class="gmail_msg">
> > # lxc list --format raw -c n
--no-header<br class="gmail_msg">
> > mysql-rep1<br class="gmail_msg">
> > mysql-rep2<br class="gmail_msg">
> > mysql-rep3<br class="gmail_msg">
> ><br class="gmail_msg">
> > The second feature looks useful is
ability run commands on multiplie<br
class="gmail_msg">
> > containers simultaneously. For
example:<br class="gmail_msg">
> ><br class="gmail_msg">
> > # lxc exec web-node* -- apt update<br
class="gmail_msg">
> ><br class="gmail_msg">
> > What do you think about it?<br
class="gmail_msg">
> > --<br class="gmail_msg">
> > WBR, Andriy Tovstik<br
class="gmail_msg">
> ><br class="gmail_msg">
> >
_______________________________________________<br
class="gmail_msg">
> > lxc-users mailing list<br
class="gmail_msg">
> > <a moz-do-not-send="true"
href="mailto:lxc-users@lists.linuxcontainers.org"
class="gmail_msg" target="_blank">lxc-users@lists.linuxcontainers.org</a><br
class="gmail_msg">
> > <a moz-do-not-send="true"
href="http://lists.linuxcontainers.org/listinfo/lxc-users"
rel="noreferrer" class="gmail_msg"
target="_blank">http://lists.linuxcontainers.org/listinfo/lxc-users</a><br
class="gmail_msg">
> ><br class="gmail_msg">
> ><br class="gmail_msg">
> >
_______________________________________________<br
class="gmail_msg">
> > lxc-users mailing list<br
class="gmail_msg">
> > <a moz-do-not-send="true"
href="mailto:lxc-users@lists.linuxcontainers.org"
class="gmail_msg" target="_blank">lxc-users@lists.linuxcontainers.org</a><br
class="gmail_msg">
> > <a moz-do-not-send="true"
href="http://lists.linuxcontainers.org/listinfo/lxc-users"
rel="noreferrer" class="gmail_msg"
target="_blank">http://lists.linuxcontainers.org/listinfo/lxc-users</a><br
class="gmail_msg">
><br class="gmail_msg">
> --<br class="gmail_msg">
> WBR, Andriy Tovstik<br class="gmail_msg">
<br class="gmail_msg">
>
_______________________________________________<br
class="gmail_msg">
> lxc-users mailing list<br
class="gmail_msg">
> <a moz-do-not-send="true"
href="mailto:lxc-users@lists.linuxcontainers.org"
class="gmail_msg" target="_blank">lxc-users@lists.linuxcontainers.org</a><br
class="gmail_msg">
> <a moz-do-not-send="true"
href="http://lists.linuxcontainers.org/listinfo/lxc-users"
rel="noreferrer" class="gmail_msg"
target="_blank">http://lists.linuxcontainers.org/listinfo/lxc-users</a><br
class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
--<br class="gmail_msg">
Stéphane Graber<br class="gmail_msg">
Ubuntu developer<br class="gmail_msg">
<a moz-do-not-send="true"
href="http://www.ubuntu.com"
rel="noreferrer" class="gmail_msg"
target="_blank">http://www.ubuntu.com</a><br
class="gmail_msg">
_______________________________________________<br class="gmail_msg">
lxc-users mailing list<br class="gmail_msg">
<a moz-do-not-send="true"
href="mailto:lxc-users@lists.linuxcontainers.org"
class="gmail_msg" target="_blank">lxc-users@lists.linuxcontainers.org</a><br
class="gmail_msg">
<a moz-do-not-send="true"
href="http://lists.linuxcontainers.org/listinfo/lxc-users"
rel="noreferrer" class="gmail_msg"
target="_blank">http://lists.linuxcontainers.org/listinfo/lxc-users</a></blockquote>
</div>
</div>
</div>
<div dir="ltr" class="gmail_msg">-- <br
class="gmail_msg">
</div>
<div data-smartmail="gmail_signature"
class="gmail_msg">
<div dir="ltr" class="gmail_msg">WBR, Andriy Tovstik</div>
</div>
<br class="gmail_msg">
<fieldset
class="m_-4332737391318974087mimeAttachmentHeader
gmail_msg"></fieldset>
<br class="gmail_msg">
<pre class="gmail_msg">_______________________________________________
lxc-users mailing list
<a moz-do-not-send="true" class="m_-4332737391318974087moz-txt-link-abbreviated gmail_msg" href="mailto:lxc-users@lists.linuxcontainers.org" target="_blank">lxc-users@lists.linuxcontainers.org</a>
<a moz-do-not-send="true" class="m_-4332737391318974087moz-txt-link-freetext gmail_msg" href="http://lists.linuxcontainers.org/listinfo/lxc-users" target="_blank">http://lists.linuxcontainers.org/listinfo/lxc-users</a></pre>
</blockquote>
<br class="gmail_msg">
</div>
_______________________________________________<br
class="gmail_msg">
lxc-users mailing list<br class="gmail_msg">
<a moz-do-not-send="true"
href="mailto:lxc-users@lists.linuxcontainers.org"
class="gmail_msg" target="_blank">lxc-users@lists.linuxcontainers.org</a><br
class="gmail_msg">
<a moz-do-not-send="true"
href="http://lists.linuxcontainers.org/listinfo/lxc-users"
rel="noreferrer" class="gmail_msg" target="_blank">http://lists.linuxcontainers.org/listinfo/lxc-users</a></blockquote>
</div>
</div>
</div>
<div dir="ltr">-- <br>
</div>
<div data-smartmail="gmail_signature">
<div dir="ltr">WBR, Andriy Tovstik</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
lxc-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:lxc-users@lists.linuxcontainers.org">lxc-users@lists.linuxcontainers.org</a>
<a class="moz-txt-link-freetext" href="http://lists.linuxcontainers.org/listinfo/lxc-users">http://lists.linuxcontainers.org/listinfo/lxc-users</a></pre>
</blockquote>
<br>
</body>
</html>