Last active
May 14, 2017 14:09
-
-
Save jhh/4c52d4d1cd0aa426713297adb38be82a to your computer and use it in GitHub Desktop.
KVM Install Notes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lvcreate -n dns01 -V 10G --thinpool vg01/pool00 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
virt-install \ | |
--name dns01 \ | |
--memory 1024 \ | |
--vcpus 2 \ | |
--controller scsi,model=virtio-scsi \ | |
--disk /dev/vg01/dns01,bus=scsi,discard=unmap \ | |
--cdrom /opt/images/CentOS-7-x86_64-Minimal.iso \ | |
--os-variant centos7.0 \ | |
--network bridge=br0,model=virtio,mac=52:54:00:66:58:d4 \ | |
--graphics vnc,listen=0.0.0.0,port=5903 \ | |
--noautoconsole |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# https://wiki.centos.org/TipsAndTricks/BridgeAndNmcli | |
IP="192.168.1.3/24" | |
GW="192.168.1.1" | |
DNS="192.168.1.2 192.168.1.7" | |
SEARCH="mynet.local" | |
ETH="eno1" | |
nmcli connection add type bridge ifname br0 | |
nmcli connection modify bridge-br0 bridge.stp no | |
nmcli connection modify bridge-br0 ipv4.method manual ipv4.address "$IP" \ | |
ipv4.gateway "$GW" ipv4.dns "$DNS" ipv4.dns-search $SEARCH | |
nmcli con add type bridge-slave ifname $ETH master bridge-br0 | |
if [[ $? -eq 0 ]]; then | |
echo added bridge slave, deleting $ETH and rebooting | |
nmcli con del $ETH; reboot | |
else | |
echo error adding bridge slave | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment