## lxd usage information ## burl="http://download.cirros-cloud.net/daily/20150923/" base="cirros-d150923-x86_64" wget "$burl/$base-lxd.tar.xz" wget "$burl/$base-lxc.tar.xz" lxc image import --alias=cirros-daily --alias="$base" \ "$base-lxd.tar.xz" "$base-lxc.tar.xz" # Now the image shows up in 'lxc image list'. # Lets launch one. $ lxc launch cirros-daily c1 $ lxc exec c1 -- hostname c1 $ /bin/sh -c 'echo instance-id=$(cirros-query get instance-id)' instance-id=c1 $ lxc stop c1 $ lxc delete c1 $ lxc delete --force c1 # You can give it user-data too. $ cat user-data #!/bin/sh echo "it is currently: $(date -R)" | tee /run/time.log $ lxc launch cirros-daily c2 "--config=user.user-data=$(cat user-data)" $ sleep 3 $ lxc exec c2 cat /run/time.log it is currently: Fri, 15 Apr 2016 15:50:33 +0100 $ lxc stop c2 $ lxc delete c2 ## creation information (for smoser) ## base=cirros-d150923-x86_64 # create the lxc.tar.xz from lxc.tar.gz zcat $base-lxc.tar.gz | xz > $base-lxc.tar.xz # create the lxd metadata tar -C lxd-meta -cvJf "$base-lxd.tar.xz" metadata.yaml templates