建立 Template 與 P2V

最後更新: 2020-01-12

目錄

  • 人手建立 Template
  • Unprivileged containers Template
  • lxc scripts

Link

 


人手建立 Template

 

Container 是一個 OS(Ubuntu, Rocky) 的整個 file system 打包再加上一些系統修改

所以一共有兩個步驟

1) 打包一個 OS 的原整檔案系統:

tar --numeric-owner -czvf /tmp/centos-6.2-i686-ispconfig3.tgz -X /root/vps_fs   /

它們是不須要打包的 !!

  • lost+found
  • /dev/*
  • /mnt/*
  • /tmp/*
  • /proc/*
  • /sys/*
  • /usr/src/*
  • /boot/*
  • /lib/modules/*
  • *.tmp
  • *.bak
  • .bash_history

2) 修改系統

 


Unprivileged containers Template

 

link

 


Setup the default mounts

 

config

lxc.include = /usr/share/lxc/config/common.conf

common.conf

...
lxc.mount.auto = cgroup:mixed proc:mixed sys:mixed
lxc.mount.entry = /sys/fs/fuse/connections sys/fs/fuse/connections none bind,optional 0 0

 

 

Creative Commons license icon Creative Commons license icon