Lab155
Скрипт переименования машин
IP=172.16.155.4 MASK=16 GW=172.16.1.1 HOST=alt-pve-155-4 echo "127.0.0.1 localhost" > /etc/hosts echo "$IP $HOST.local $HOST" >> /etc/hosts echo "$HOST" > /etc/hostname rm -rf /etc/net/ifaces/* mkdir /etc/net/ifaces/vmbr0 cat << EOF > /etc/net/ifaces/vmbr0/options TYPE=bri VLAN_AWARE=yes VIDS=2-2048 ONBOOT=yes DISABLED=no NM_CONTROLLED=no CONFIG_WIRELESS=no CONFIG_IPV4=yes CONFIG_IPV6=no BOOTPROTO=static HOST="eth0" EOF echo "$IP/$MASK" > /etc/net/ifaces/vmbr0/ipv4address echo "default via $GW" > /etc/net/ifaces/vmbr0/ipv4route echo "nameserver $GW" > /etc/net/ifaces/vmbr0/resolve.conf cat << EOF > /etc/sysconfig/network # When set to no, this may cause most daemons' initscripts skip starting. NETWORKING=yes # Used by hotplug/pcmcia/ifplugd scripts to detect current network config # subsystem. CONFMETHOD=etcnet # Used by rc.sysinit to setup system hostname at boot. HOSTNAME=$HOST # This is used by ALTLinux ppp-common to decide if we want to install # nameserver lines into /etc/resolv.conf or not. RESOLV_MODS=yes EOF
Подключить локальную хранилку
DISK="/dev/sda" fdisk $DISK <<EOF d 2 n p 2 N w EOF pvresize "${DISK}2" vgchange -ay lvcreate -y alt-vg --name vmstorage -L 400g zpool create zfspool /dev/alt-vg/vmstorage -f zfs set compression=off zfspool zfs set sync=disabled zfspool mkdir /zfspool/storage chown storage:storage /zfspool/storage -R pvesm add zfspool vmstorage --pool zfspool --content images,rootdir
Подключение хранилок
Подключиться по ssh!
pvesm add cifs pveshare --server 172.16.254.123 --share mcluster1 --username mcluster1 --password --content iso,backup pvesm add cifs pveshare1 --server 172.16.254.123 --share mcluster1_1 --username mcluster1 --password --content iso,backup pvesm add cifs pveshare2 --server 172.16.254.123 --share mcluster1_2 --username mcluster1 --password --content iso,backup