[lxc-users] Setting gateway via python-lxc

BB eeg5auquaephoo5j at gmail.com
Mon Jan 5 19:28:36 UTC 2015


Remark:

While the netmask is now set,  I get duplicated entries :-)

Example (no 'lxc.network.0.ipv4" in the config yet!):

   >>> db = lxc.Container('db')
   >>> db.get_config_item('lxc.network.0.ipv4')
   ''
   >>> db.set_config_item('lxc.network.0.ipv4', '10.4.4.4/24')
   True
   >>> db.save_config()
   True

Now the config contains:

    lxc.network.0.ipv4 =
    lxc.network.0.ipv4 = 10.4.4.4/24




On Mon, Jan 5, 2015 at 6:27 PM, BB <eeg5auquaephoo5j at gmail.com> wrote:

> Ok, I tried again with 1.0.6 and it failed (as expected).
>
> Then I updated to the ppa version
> (1.1.0~alpha3+master~20150101-2236-0ubuntu1~trusty) and ... surprise ... it
> works :-)
>
> Thanks for the hint. I hope the newer versions get's into trusty-updates
> sooner or later.
>
> Best regards,
>
> BB
>
> On Mon, Jan 5, 2015 at 6:17 PM, Serge Hallyn <serge.hallyn at ubuntu.com>
> wrote:
>
>> Could you try using ppa:ubuntu-lxc/daily?
>>
>> Though really 1.0.6 should have any fixes that were added to
>> config saving...  but still worth a try.
>>
>> Quoting BB (eeg5auquaephoo5j at gmail.com):
>> > Hi,
>> >
>> > I am using 1.0.6-0ubuntu0.1 on Ubuntu trusty... actually that version is
>> > from trusty-updates. The lxc, liblxc1, and lxc-templates packages have
>> the
>> > same version.
>> >
>> > Kind regards,
>> >
>> > BB
>> >
>> > On Mon, Jan 5, 2015 at 5:54 PM, Serge Hallyn <serge.hallyn at ubuntu.com>
>> > wrote:
>> >
>> > > Quoting BB (eeg5auquaephoo5j at gmail.com):
>> > > > Hallo again,
>> > > >
>> > > > I just noticed that even though I set:
>> > > >      >>> container.network[0].ipv4 = '10.0.10.3/24'
>> > > >
>> > > >      >>> container.network[0].ipv4
>> > > >      ['10.0.10.3']
>> > > >      >>> container.save_config()
>> > > >
>> > > > The container's config contains:
>> > > >      lxc.network.ipv4 = 10.0.10.3/8
>> > > >
>> > > > I also tried:
>> > > >     >>> container.set_config_item('lxc.network.0.ipv4', '
>> 10.0.10.3/24')
>> > > >     False
>> > >
>> > > For me it gives me
>> > >
>> > > lxc.network.0.ipv4 = 10.0.10.3/24
>> > >
>> > > What version are you using?
>> > > _______________________________________________
>> > > lxc-users mailing list
>> > > lxc-users at lists.linuxcontainers.org
>> > > http://lists.linuxcontainers.org/listinfo/lxc-users
>>
>> > _______________________________________________
>> > lxc-users mailing list
>> > lxc-users at lists.linuxcontainers.org
>> > http://lists.linuxcontainers.org/listinfo/lxc-users
>>
>> _______________________________________________
>> lxc-users mailing list
>> lxc-users at lists.linuxcontainers.org
>> http://lists.linuxcontainers.org/listinfo/lxc-users
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20150105/4f5a0ade/attachment-0001.html>


More information about the lxc-users mailing list