You are the man....it worked like a charm. Thanks a lot you saved from some
hours of needless experimentation.
Best
Alex

On Wed, Jan 15, 2020 at 10:23 PM Stéphane Graber <stgra...@stgraber.org>
wrote:

> 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.
>
> On Wed, Jan 15, 2020 at 2:41 PM alexandros giavaras <a.giava...@gmail.com>
> wrote:
>
>> Stephane,
>>
>> Thanks a lot for your reply. I have already came up with the dict
>> specification but thanks a lot for confirming me.
>> 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
>> 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
>>
>> "MyDataVolume:{
>> "path":"/opt/data"
>> "type":"disk"
>> "source":"/Volume"
>> }
>>
>> pylxd.exceptions.LXDAPIException: Create container: Invalid devices:
>> Missing source '/Volume' for disk 'MyDataVolume'.
>>
>> Thanks in advance.
>> Best
>> Alex
>>
>> On Wed, Jan 15, 2020 at 5:04 PM Stéphane Graber <stgra...@stgraber.org>
>> wrote:
>>
>>> Same in both cases, such volumes are disk devices attached to the
>>> container.
>>> At creation time, you'd add such a device in the `devices` dict sent
>>> through the POST request.
>>> After creation time, you'd fetch the current config using GET, add the
>>> device to devices and then PUT it back.
>>>
>>> On Wed, Jan 15, 2020 at 6:57 AM alexandros giavaras <
>>> a.giava...@gmail.com> wrote:
>>>
>>>> Hi all,
>>>>
>>>> I was wondering about two related issues.
>>>>
>>>> The first one is this. I am trying to create a container via the REST
>>>> API. I want to attach to it
>>>> 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.
>>>>
>>>> The second issue is this. I have a container already running and I want
>>>> to attach to it
>>>> an already existing volume. How do I do this via the REST API?
>>>> Thanks in advance.
>>>> Best
>>>> Alex
>>>> _______________________________________________
>>>> lxc-users mailing list
>>>> lxc-users@lists.linuxcontainers.org
>>>> http://lists.linuxcontainers.org/listinfo/lxc-users
>>>>
>>>
>>>
>>> --
>>> Stéphane
>>> _______________________________________________
>>> lxc-users mailing list
>>> lxc-users@lists.linuxcontainers.org
>>> http://lists.linuxcontainers.org/listinfo/lxc-users
>>>
>> _______________________________________________
>> lxc-users mailing list
>> lxc-users@lists.linuxcontainers.org
>> http://lists.linuxcontainers.org/listinfo/lxc-users
>>
>
>
> --
> Stéphane
> _______________________________________________
> lxc-users mailing list
> lxc-users@lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-users
>
_______________________________________________
lxc-users mailing list
lxc-users@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users

Reply via email to