ubuntu18 LXD 体验

ubuntu18 安装lxdUpdate ubuntuapt update -y && apt upgrade -y Add new useradduser <user>例如:root@ubuntu-18:~# adduser fangAdding user `fang' ...Adding new group `fang' (1001) ...Adding new user `fang' (1001) with group `fang' ...Crea
摘要由CSDN通过智能技术生成

ubuntu18 安装lxd

Update ubuntu

apt update -y && apt upgrade -y 

Add new user

adduser <user>

例如:

root@ubuntu-18:~# adduser fang
Adding user `fang' ...
Adding new group `fang' (1001) ...
Adding new user `fang' (1001) with group `fang' ...
Creating home directory `/home/fang' ...
Copying files from `/etc/skel' ...
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for fang

apt remove LXD & add the LXD Group

$ apt remove --purge lxd lxd-client

$ groupadd --system lxd

$ usermod -G lxd -a <user>

Update the permessions

newgrp lxd

install LXD

snap install lxd

or

snap install lxd --channel=3.0/stable

Install zfsutils-linux

sudo apt install zfsutils-linux

LXD initialization process

sudo lxd init

例如:

root@ubuntu-18:~# sudo lxd init
Would you like to use LXD clustering? (yes/no) [default=no]:
Do you want to configure a new storage pool? (yes/no) [default=yes]:
Name of the new storage pool [default=default]:
Name of the storage backend to use (btrfs, dir, lvm, zfs, ceph) [default=zfs]:
Create a new ZFS pool? (yes/no) [default=yes]:
Would you like to use an existing empty block device (e.g. a disk or partition)? (yes/no) [default=no]:
Size in GB of the new loop device (1GB minimum) [default=30GB]:
Would you like to connect to a MAAS server? (yes/no) [default=no]:
Would you like to create a new local network bridge? (yes/no) [default=yes]:
What should the new bridge be called? [default=lxdbr0]:
What IPv4 address should be used? (CIDR subnet notation, “auto” or “none”) [default=auto]:
What IPv6 address should be used? (CIDR subnet notation, “auto” or “none”) [default=auto]:
Would you like the LXD server to be available over the network? (yes/no) [default=no]:
Would you like stale cached images to be updated automatically? (yes/no) [default=yes]
Would you like a YAML "lxd init" preseed to be printed? (yes/no) [default=no]:

LXD 常用配置

lanunch instance


lxc launch imageserver:imagename   instancename

例如:
fang@ubuntu-18:~$ lxc launch images:centos/7/amd64 centos7
Creating centos7
Starting centos7

fang@ubuntu-18:~$ lxc launch ubuntu:18.04 CTNAME
Creating CTNAME
Starting CTNAME

fang@ubuntu-18:~$ lxc image list
+-------+--------------+--------+---------------------------------------------+--------------+-----------+----------+-----------------------------+
| ALIAS | FINGERPRINT  | PUBLIC |                 DESCRIPTION                 | ARCHITECTURE |   TYPE    |   SIZE   |         UPLOAD DATE         |
+-------+--------------+--------+---------------------------------------------+--------------+-----------+----------+-----------------------------+
|       | 5a4a2ba32e1f | no     | Centos 7 amd64 (20210831_07:08)             | x86_64       | CONTAINER | 84.44MB  | Sep 1, 2021 at 6:49am (UTC) |
+-------+--------------+--------+---------------------------------------------+--------------+-----------+------
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值