Re: How to use LXC local image for new machine

2017-09-06 Thread fengxia

To give an update on this, and it can be helpful to someone interested in:

Verified.

1. create a vanilla `trusty` LXD container named `gold`
2. ssh into `gold` container, `apt install python python-dev...`
3. in terminal, `$ lxc snapshot gold`, this created a snapshot, can be 
viewed from `$ lxc info gold`.

4. in terminal, `$ lxc publish gold/snap0 --alias juju/trusty/amd64`
5. `$ lxc image delete ubuntu-trusty`. This is to delete the default 
ubuntu-trusty image downloaded by LXD.


6. Update juju to 2.2.2 (https://jujucharms.com/docs/2.2/reference-install)
7. re-bootstrap a controller (juju bootstrap localhost [pick a name])

It is now using a local image w/ alias `juju/trusty/amd64`.

Thank you Juju.


On 09/01/2017 06:47 AM, Stuart Bishop wrote:

On 1 September 2017 at 02:37, fengxia  wrote:

According to https://bugs.launchpad.net/juju/+bug/1650651, juju 2.1 supports
using local image if its alias is `juju/series/arch` format.

So following this, I created a local image and gave it an alias of this
format, but juju deploy will still download ubuntu-trusty before creating
the container.

I'm attaching the script I'm using, which is slightly modified from
the original version passed around and posted here. It might point you
to where your process is failing. I haven't done it manually myself.



--
Feng xia
Engineer
Lenovo USA

Phone: 5088011794
fx...@lenovo.com

Lenovo.com
Twitter | Facebook | Instagram | Blogs | Forums

-- 
Juju mailing list
Juju@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju


Re: How to use LXC local image for new machine

2017-09-03 Thread John Meinel
If you're seeing "ubuntu-trusty" then you're using a version of Juju that
doesn't support the pressed. I believe reusing the cached image first was
added in 2.1, when we switched the naming scheme to be more specific.

John
=:->

On Sep 1, 2017 18:10, "Alex Kavanagh"  wrote:

>
>
> On Fri, Sep 1, 2017 at 11:47 AM, Stuart Bishop <
> stuart.bis...@canonical.com> wrote:
>
>> On 1 September 2017 at 02:37, fengxia  wrote:
>> > According to https://bugs.launchpad.net/juju/+bug/1650651, juju 2.1
>> supports
>> > using local image if its alias is `juju/series/arch` format.
>> >
>> > So following this, I created a local image and gave it an alias of this
>> > format, but juju deploy will still download ubuntu-trusty before
>> creating
>> > the container.
>>
>> I'm attaching the script I'm using, which is slightly modified from
>> the original version passed around and posted here. It might point you
>> to where your process is failing. I haven't done it manually myself.
>>
>
> Thanks Stuart; that looks really useful.
>
> Cheers
> Alex.
>
>
> --
> Juju mailing list
> Juju@lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/
> mailman/listinfo/juju
>
>
-- 
Juju mailing list
Juju@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju


Re: How to use LXC local image for new machine

2017-09-01 Thread Alex Kavanagh
On Fri, Sep 1, 2017 at 11:47 AM, Stuart Bishop 
wrote:

> On 1 September 2017 at 02:37, fengxia  wrote:
> > According to https://bugs.launchpad.net/juju/+bug/1650651, juju 2.1
> supports
> > using local image if its alias is `juju/series/arch` format.
> >
> > So following this, I created a local image and gave it an alias of this
> > format, but juju deploy will still download ubuntu-trusty before creating
> > the container.
>
> I'm attaching the script I'm using, which is slightly modified from
> the original version passed around and posted here. It might point you
> to where your process is failing. I haven't done it manually myself.
>

Thanks Stuart; that looks really useful.

Cheers
Alex.
-- 
Juju mailing list
Juju@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju


Re: How to use LXC local image for new machine

2017-09-01 Thread Stuart Bishop
On 1 September 2017 at 02:37, fengxia  wrote:
> According to https://bugs.launchpad.net/juju/+bug/1650651, juju 2.1 supports
> using local image if its alias is `juju/series/arch` format.
>
> So following this, I created a local image and gave it an alias of this
> format, but juju deploy will still download ubuntu-trusty before creating
> the container.

I'm attaching the script I'm using, which is slightly modified from
the original version passed around and posted here. It might point you
to where your process is failing. I haven't done it manually myself.

-- 
Stuart Bishop 


lxdseed
Description: Binary data
-- 
Juju mailing list
Juju@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju


Re: How to use LXC local image for new machine

2017-08-31 Thread fengxia
According to https://bugs.launchpad.net/juju/+bug/1650651, juju 2.1 
supports using local image if its alias is `juju/series/arch` format.


So following this, I created a local image and gave it an alias of this 
format, but juju deploy will still download ubuntu-trusty before 
creating the container.


Below is dump from `lxc image [image-name] info`:

fengxia@local-charmdev:~/workspace/wss$ lxc image info trusty
Fingerprint: 
203a6ae7d45cbe5c1411ad3f17b9b2429cb5ddfec69019fa96ce5710c4871504

Size: 365.92MB
Architecture: x86_64
Public: no
Timestamps:
Uploaded: 2017/08/31 14:32 UTC
Expires: never
Last used: never
Properties:
label: release
os: ubuntu
release: trusty
serial: 20170811
version: 14.04
architecture: amd64
description: ubuntu 14.04 LTS amd64 (release) (20170811)
Aliases:
- gold-image (gold-image)
- trusty (trusty)
- juju/trusty/amd64 (juju/trusty/amd64)
Auto update: disabled



On 08/31/2017 02:20 PM, fengxia wrote:

Hi Juju,

I'm using `localhost` provider for dev test. I have create a LXD 
controller, and each time `juju deploy` will create a new container 
(series/trusty).


I'm experimenting to use a local image so `juju deploy` can use. So far:

1. Created an image, "gold-copy"

2. `lxc image alias create trusty [hash]`, also created alias 
`ubuntu-trusty`


But no avail. Juju will continue to download a `ubuntu-trusty` image 
to use.


Any advice here?

btw, the ultimate goal is to shorten the cycle of getting a new 
machine. The thought is to provide a customized image that has 
packages pre-loaded, eg python, python-dev, and a few charm libs.


I also read somewhere about juju using `clone-image`? Any detail on 
this function?




--
Feng xia
Engineer
Lenovo USA

Phone: 5088011794
fx...@lenovo.com

Lenovo.com
Twitter | Facebook | Instagram | Blogs | Forums

-- 
Juju mailing list
Juju@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju


How to use LXC local image for new machine

2017-08-31 Thread fengxia

Hi Juju,

I'm using `localhost` provider for dev test. I have create a LXD 
controller, and each time `juju deploy` will create a new container 
(series/trusty).


I'm experimenting to use a local image so `juju deploy` can use. So far:

1. Created an image, "gold-copy"

2. `lxc image alias create trusty [hash]`, also created alias 
`ubuntu-trusty`


But no avail. Juju will continue to download a `ubuntu-trusty` image to 
use.


Any advice here?

btw, the ultimate goal is to shorten the cycle of getting a new machine. 
The thought is to provide a customized image that has packages 
pre-loaded, eg python, python-dev, and a few charm libs.


I also read somewhere about juju using `clone-image`? Any detail on this 
function?


--
Feng xia
Engineer
Lenovo USA

Phone: 5088011794
fx...@lenovo.com

Lenovo.com
Twitter | Facebook | Instagram | Blogs | Forums


--
Juju mailing list
Juju@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju