설치 확인하는법: snap list snap services // 이거할때 데몬에러뜸 하지만 무시
// 여기까지 진행 후 Reboot으로 시스템 재부팅
Step 7 – LXD 설정
sudo usermod -a -G lxd vivek newgrp lxd id
// LXC 서버 확인 (생성된 컨테이너를 확인할 수 있다. 하지만 지금은 초기라 List에 뜨는게 없을꺼임) lxc list
[root@localhost 아무개]# lxc image list images: +--------------------------------------+--------------+--------+----------------------------------------------+---------+-----------+-------------------------------+ | ALIAS | FINGERPRINT | PUBLIC | DESCRIPTION | ARCH | SIZE | UPLOAD DATE | +--------------------------------------+--------------+--------+----------------------------------------------+---------+-----------+-------------------------------+ | alpine/3.6 (3 more) | d3416fd3f3e3 | yes | Alpine 3.6 amd64 (20190528_13:00) | x86_64 | 3.17MB | May 28, 2019 at 12:00am (UTC) | +--------------------------------------+--------------+--------+----------------------------------------------+---------+-----------+-------------------------------+ | alpine/3.6/arm64 (1 more) | cc9107640c99 | yes | Alpine 3.6 arm64 (20190528_13:02) | aarch64 | 3.07MB | May 28, 2019 at 12:00am (UTC) | +--------------------------------------+--------------+--------+----------------------------------------------+---------+-----------+-------------------------------+
// LXC Storage 생성 (컨테이너를 생성하기위한 스토리지 생성단계) lxd init
[root@localhost 아무개]# 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, ceph, dir, lvm) [default=btrfs]: lvm Create a new LVM pool? (yes/no) [default=yes]: Would you like to use an existing block device? (yes/no) [default=no]: Size in GB of the new loop device (1GB minimum) [default=15GB]: 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 LXD 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]:
[root@localhost 아무개]# lxc storage list // 생성된 스토리지 확인 +---------+-------------+--------+--------------------------------------------+---------+ | NAME | DESCRIPTION | DRIVER | SOURCE | USED BY | +---------+-------------+--------+--------------------------------------------+---------+ | default | | lvm | /var/snap/lxd/common/lxd/disks/default.img | 1 | +---------+-------------+--------+--------------------------------------------+---------+
Step 8 – 첫번째 컨테이너 생성하기
// 아래의 명령어를 사용하면 설치할수 있는 컨테이너의 List가 출력됨(무수히 많음)
lxc image list images: // 전체 리스트 $ lxc image list images: | grep -i centos // Centos 리스트 $ lxc image list images: | grep -u ubuntu // Ubuntu 리스트
lxc launch images:{운영체제}/{버전}/{비트?} {컨테이너 이름} Let us see some examples to create and start containers from various Linux distro images as per your needs.
[root@localhost 아무개]# lxc launch images:centos/7/amd64 test Creating test Starting test