<div dir="ltr"><div>You are the man....it worked like a charm. Thanks a lot you saved from some hours of needless experimentation.</div><div>Best</div><div>Alex<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jan 15, 2020 at 10:23 PM Stéphane Graber <<a href="mailto:stgraber@stgraber.org">stgraber@stgraber.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">In this case the "source" key must be set to the name of your custom volume and the "pool" key set to the name of your pool.<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jan 15, 2020 at 2:41 PM alexandros giavaras <<a href="mailto:a.giavaras@gmail.com" target="_blank">a.giavaras@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Stephane,</div><div><br></div><div>Thanks a lot for your reply. I have already came up with the dict specification but thanks a lot for confirming me. <br></div><div>Most likely I was not so clear to what I was asking. So let's put it this way. I have a storage pool named Pool and I have associated <br></div><div>a volume with it let's call it Volume. Now I am creating the container and I want to attach Volume to it. Here is my non-working dict specification</div><div><br></div><div>"MyDataVolume:{</div><div>"path":"/opt/data"</div><div>"type":"disk"</div><div>"source":"/Volume"<br></div><div>}</div><div><br></div><div>pylxd.exceptions.LXDAPIException: Create container: Invalid devices: Missing source '/Volume' for disk 'MyDataVolume'.</div><div><br></div><div>Thanks in advance.<br></div><div>Best</div><div>Alex<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jan 15, 2020 at 5:04 PM Stéphane Graber <<a href="mailto:stgraber@stgraber.org" target="_blank">stgraber@stgraber.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Same in both cases, such volumes are disk devices attached to the container.</div><div>At creation time, you'd add such a device in the `devices` dict sent through the POST request.</div><div>After creation time, you'd fetch the current config using GET, add the device to devices and then PUT it back.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jan 15, 2020 at 6:57 AM alexandros giavaras <<a href="mailto:a.giavaras@gmail.com" target="_blank">a.giavaras@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi all,</div><div><br></div><div>I was wondering about two related issues.</div><div><br></div><div>The first one is this. I am trying to create a container via the REST API. I want to attach to it <br></div><div>an already existing storage volume from a storage pool. Could anyone please indicate how I should fill in the input json because I don't seem able to find anything useful. <br></div><div><br></div><div>The second issue is this. I have a container already running and I want to attach to it</div><div>an already existing volume. How do I do this via the REST API?</div><div>Thanks in advance.</div><div>Best</div><div>Alex<br></div></div>
_______________________________________________<br>
lxc-users mailing list<br>
<a href="mailto:lxc-users@lists.linuxcontainers.org" target="_blank">lxc-users@lists.linuxcontainers.org</a><br>
<a href="http://lists.linuxcontainers.org/listinfo/lxc-users" rel="noreferrer" target="_blank">http://lists.linuxcontainers.org/listinfo/lxc-users</a><br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr">Stéphane</div>
_______________________________________________<br>
lxc-users mailing list<br>
<a href="mailto:lxc-users@lists.linuxcontainers.org" target="_blank">lxc-users@lists.linuxcontainers.org</a><br>
<a href="http://lists.linuxcontainers.org/listinfo/lxc-users" rel="noreferrer" target="_blank">http://lists.linuxcontainers.org/listinfo/lxc-users</a><br>
</blockquote></div>
_______________________________________________<br>
lxc-users mailing list<br>
<a href="mailto:lxc-users@lists.linuxcontainers.org" target="_blank">lxc-users@lists.linuxcontainers.org</a><br>
<a href="http://lists.linuxcontainers.org/listinfo/lxc-users" rel="noreferrer" target="_blank">http://lists.linuxcontainers.org/listinfo/lxc-users</a><br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr">Stéphane</div>
_______________________________________________<br>
lxc-users mailing list<br>
<a href="mailto:lxc-users@lists.linuxcontainers.org" target="_blank">lxc-users@lists.linuxcontainers.org</a><br>
<a href="http://lists.linuxcontainers.org/listinfo/lxc-users" rel="noreferrer" target="_blank">http://lists.linuxcontainers.org/listinfo/lxc-users</a><br>
</blockquote></div>