Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagebash
# clone, but you still have to manually change the host file
sudo lxc-clone -o original -n new
sudo sed -i 's/original/new/' /var/lib/lxc/new/rootfs/etc/hosts # update host file

Clear Out Old Data

Log Files

If you need to be enterprise class, clear out your new cloned containers log files which will reference the original container hostname. Here is an example search on a relatively new container,

...

Code Block
cd /var/lib/lxc/t02app/rootfs/var/log
# this does not work yet...
foreach ii ( `find . -type f` ) foreach? cp /dev/null $ii foreach? end
# delete gz files

There's more... user history... 

Regenerate SSH Host Keys

...

Clean up log files - http://serverfault.com/questions/185253/delete-all-of-var-log
Clean up log files + more - https://lonesysadmin.net/2013/03/26/preparing-linux-template-vms/