<template>
<name>Debian8.7-zxy</name>
<os>
<name>Debian</name>
<version>8</version>
<arch>x86_64</arch>
<install type='iso'>
<iso>file:///data/md0/DVD/debian-8.7.0-amd64-DVD-1.iso</iso>
</install>
<rootpw>123123</rootpw>
</os>
<disk>
<size>20</size>
</disk>
<description>Debian8.7 x86_64</description>
<commands>
<command name='install_qga'>
cd /root
tar xf qga.debian.tar.gz
cd qga
bash -x ./install_qga_local.sh
</command>
<command name='console'>
sed -i 's/splash//g' /etc/default/grub
sed -i 's/quiet/console=ttyS0/g' /etc/default/grub
/usr/sbin/update-grub
</command>
<command name='packages'>
mv /etc/apt/sources.list /etc/apt/sources.list.old
mv /root/sources.list /etc/apt/
rm -rf /var/lib/apt/lists/*
apt-get clean
apt-get update
apt-get -y install acpid
apt-get -y install curl
apt-get -y install sysv-rc-conf
apt-get -y install network-manager
apt-get -y install cloud-init-*
apt-get -y install cloud-utils
</command>
<command name='modify'>
echo -n > /etc/udev/rules.d/70-persistent-net.rules
echo -n > /lib/udev/rules.d/75-persistent-net-generator.rules
sed -i '/exit 0/d' /etc/rc.local
echo "/usr/local/bin/nic_set_mq.sh > /tmp/nic_set_mq.log 2>&1" >> /etc/rc.local
echo "exit 0">>/etc/rc.local
echo 'blacklist intel_rapl' >> /etc/modprobe.d/modprobe.conf
chmod +x /var/lib/cloud/scripts/per-boot/resetroot
chmod +x /usr/local/bin/nic_set_mq.sh
chmod +x /var/lib/cloud/scripts/per-instance/ssh.sh
chmod +x /etc/rc.local
rm -rf /etc/cloud/cloud.cfg
rm -rf /etc/cloud/cloud.cfg.d/90_dpkg.cfg
mv /root/cloud.cfg /etc/cloud/
mv /root/90_dpkg.cfg /etc/cloud/cloud.cfg.d/
rm -rf /etc/apt/sources.list
mv /etc/apt/sources.list.old /etc/apt/sources.list
apt-get clean
apt-get update
cat >> /usr/local/bin/instance_init.sh << EOF
if [ ! -d /root/.ssh ]; then
mkdir -p /root/.ssh
chmod 700 /root/.ssh
fi
</command>
<command name='services'>
systemctl enable acpid
systemctl enable qemu-guest-agent
systemctl enable network-manager
systemctl enable cloud-init
systemctl enable cloud-config
systemctl enable cloud-final
systemctl enable cloud-init-local
</command>
<command name='clear-logs'>
rm -rf /root/*
rm -rf /var/log/alternatives.log
rm -rf /var/log/daemon.log
rm -rf /var/log/debug
rm -rf /var/log/dmesg
rm -rf /var/log/faillog
rm -rf /var/log/fontconfig.log
rm -rf /var/log/messages
rm -rf /var/log/user.log
rm -rf /var/log/unattended-upgrades
rm -rf /var/log/auth.log
rm -rf /var/log/dpkg.log
rm -rf /var/log/syslog
rm -rf /var/log/kern.log
rm -rf /var/log/cloud-init.log
rm -rf /var/log/cloud-init-output.log
rm -rf /var/log/btmp
rm -rf /var/log/wtmp
rm -rf /var/log/lastlog
rm -rf /var/log/installer/
rm -rf /var/log/apt/
rm -rf /var/lib/apt/lists/*
rm -rf /var/lib/dhcp/*.leases
</command>
</commands>
<files>
<file name="/root/qga.debian.tar.gz" type="url">
file:///data/nvme0n1/oz/qga.debian.tar.gz
</file>
<file name="/var/lib/cloud/scripts/per-boot/resetroot" type="url">
file:///data/nvme0n1/oz/resetroot
</file>
<file name="/root/cloud.cfg" type="url">
file:///data/nvme0n1/oz/cloud.cfg_debian
</file>
<file name="/usr/local/bin/nic_set_mq.sh" type="url">
file:///data/nvme0n1/oz/nic_set_mq.sh
</file>
<file name="/var/lib/cloud/scripts/per-instance/ssh.sh" type="url">
file:///data/nvme0n1/oz/ssh-debian87.sh
</file>
<file name="/root/sources.list" type="url">
file:///data/nvme0n1/oz/sources.aliyun.debian
</file>
<file name="/etc/cloud/cloud.cfg.d/99-disable-network-config.cfg" type="url">
file:///data/nvme0n1/oz/99-disable-network-config.cfg
</file>
<file name="/root/90_dpkg.cfg" type="url">
file:///data/nvme0n1/oz/90_dpkg.cfg_debian87
</file>
<file name="/etc/default/grub" type="url">
file:///data/nvme0n1/oz/grub_debian
</file>
</files>
</template>