Skip to content

Instantly share code, notes, and snippets.

@auth-day
Last active September 9, 2018 12:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save auth-day/2fc1835c1d80b932833c3ab599540317 to your computer and use it in GitHub Desktop.
Save auth-day/2fc1835c1d80b932833c3ab599540317 to your computer and use it in GitHub Desktop.
Create vm in kvm
#!/bin/bash
virt-install -n $1 \
--noautoconsole \
--network=bridge:virbr0 \
--ram 2024 \
--arch=x86_64 \
--vcpus=2 \
--cpu host-model-only \
--check-cpu \
--disk path=/kvm/images/$1.img,size=16 \
--location=/kvm/iso/CentOS-7-x86_64-Minimal-1602-99.iso \
--graphics vnc,listen=0.0.0.0,password=password \
--os-type linux \
--os-variant=rhel7 \
--boot cdrom,hd,menu=on \
-x "ks=http://ip_where_nginx_is_running_and_is_having_ks.cfg/ks.cfg" \
--debug
# Можно добавить статический адрес через kickstart: ks=http://ip_where_nginx_is_running_and_is_having_ks.cfg/ks.cfg
# ksdevice=eth0 ip=10.10.21.76 netmask=255.255.255.240 dns=10.10.21.1 gateway=10.10.21.100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment