Skip to main content

系統優化

安裝 KVM 模板

1. 線上下載安裝
/usr/share/cloudstack-common/scripts/storage/secondary/cloud-install-sys-tmplt \
-m /storage/nfs/s \
-u http://download.cloudstack.org/systemvm/4.15/systemvmtemplate-4.15.1-kvm.qcow2.bz2 \
-h kvm -F

2. 本地安裝
/usr/share/cloudstack-common/scripts/storage/secondary/cloud-install-sys-tmplt \
-m /export/secondary \
-f /root/systemvmtemplate-4.15.1-kvm.qcow2.bz2 \
-h kvm -F

全域設定
cpu.overprovisioning.factor 2.0 //CPU超配
mem.overprovisioning.factor 2.0 //記憶體超配,即2GB變4GB
secstorage.allowed.internal.sites 0.0.0.0/0 //從該網段下載ISO或模板,後期搭建ngix伺服器可修改
management.network.cidr 192.168.100.0/24 //管理網段,可不修改,但會有警報資訊

system.vm.use.local.storage      [set false to -> true\
ca.plugin.root.auth.strictness      [set true to -> false
secstorage.allowed.internal.sites    [set value = 10.66.11.9(local server ip using apache web server for download iso

host 你的manager主機的ip
cpu.overprovisioning.factor    2.0
mem.overprovisioning.factor 2.0
secstorage.allowed.internal.sites 0.0.0.0/0



KVM : 所有VMs都需要支持virtio驱动。Linux kernel versions 2.6.25和更高版本中已经安装了这些驱动。管理员必须在virtio的配置文件中配置CONFIG_VIRTIO_BALLOON=y。

vim /etc/cloudstack/agent/agent.properties
guest.cpu.mode=host-model
host-model 表示從可用的CPU模型中選擇一個與宿主機最接近的。


服務重起
systemctl restart cloudstack-management
systemctl cloudstack-agent start

Log查看
tail -f /var/log/cloudstack/management/management-server.log

mysql
innodb_rollback_on_timeout=1
innodb_lock_wait_timeout=600
max_connections=350
log-bin=mysql-bin
binlog-format = 'ROW'
bind-address = 0.0.0.0

# nfs Server
/export/primary *(rw,async,no_root_squash,no_subtree_check)
/sbin/rpc.statd --no-notify --port 662 --outgoing-port 2020

mount -t nfs 10.66.100.30:/export/secondary /mnt/secondary

cloudstack-setup-databases cloud:123456@localhost --deploy-as=root:12345
cloudstack-setup-management

# Disable automatic upgrades and unnecessary packages:
apt-get remove --purge unattended-upgrades snapd cloud-init
# Edit the files at /etc/apt/apt.conf.d/* with following
APT::Periodic::Update-Package-Lists "0";
APT::Periodic::Unattended-Upgrade "1";