Alfred's spAcE

2015.12.21

Import non-ubuntu image in lxd

Filed under: Linux, misc — Tags: — Alfred Yang @ 13:08

Now, lxd-images can only import Ubuntu images from Ubuntu cloud images.

$ lxd-images import -h
usage: lxd-images import [-h] {busybox,ubuntu} ...

positional arguments:
 {busybox,ubuntu}
 busybox Busybox image
 ubuntu Ubuntu images

optional arguments:
 -h, --help show this help message and exit

However, we still can see a lot of lxd images on https://images.linuxcontainers.org, how to copy CentOS image from it?

We can add remote site by “lxc remote add”, then you can use “lxc image copy” to copy remote image to your local.

2015.07.04

Change the alias of lxc image

Filed under: Linux — Tags: , , — Alfred Yang @ 22:00

After using lxd-images to import some images from linuxcontainers.org, I think the alias I originally use is too long. But it takes me some time to find a way to change the alias. Finally, I find I can add an alias, then delete the old one.
$ lxc image list
+---------------+--------------+--------+-------------+--------+------------------------------+
| ALIAS | FINGERPRINT | PUBLIC | DESCRIPTION | ARCH | UPLOAD DATE |
+---------------+--------------+--------+-------------+--------+------------------------------+
| ubuntu-trusty | 04aac4257341 | no | | x86_64 | Jul 4, 2015 at 8:29am (CST) |
| centos6 | afae698680fc | no | | x86_64 | Jul 4, 2015 at 10:28am (CST) |
+---------------+--------------+--------+-------------+--------+------------------------------+
$ lxc image alias create trusty 04aac4257341
$ lxc image list
+-----------------+--------------+--------+-------------+--------+------------------------------+
| ALIAS | FINGERPRINT | PUBLIC | DESCRIPTION | ARCH | UPLOAD DATE |
+-----------------+--------------+--------+-------------+--------+------------------------------+
| trusty (1 more) | 04aac4257341 | no | | x86_64 | Jul 4, 2015 at 8:29am (CST) |
| centos6 | afae698680fc | no | | x86_64 | Jul 4, 2015 at 10:28am (CST) |
+-----------------+--------------+--------+-------------+--------+------------------------------+
$ lxc image alias delete ubuntu-trusty
$ lxc image list
+---------+--------------+--------+-------------+--------+------------------------------+
| ALIAS | FINGERPRINT | PUBLIC | DESCRIPTION | ARCH | UPLOAD DATE |
+---------+--------------+--------+-------------+--------+------------------------------+
| trusty | 04aac4257341 | no | | x86_64 | Jul 4, 2015 at 8:29am (CST) |
| centos6 | afae698680fc | no | | x86_64 | Jul 4, 2015 at 10:28am (CST) |
+---------+--------------+--------+-------------+--------+------------------------------+