Skip to content

Instantly share code, notes, and snippets.

@arbeitandy
Created February 3, 2013 21:50
Show Gist options
  • Save arbeitandy/4703820 to your computer and use it in GitHub Desktop.
Save arbeitandy/4703820 to your computer and use it in GitHub Desktop.
command to start a kvm new guest
#!/bin/bash
export NEWGUEST="sample-template"
export NEWGUEST_RAM=512
export NEWGUEST_CPU=1
export KS_PATH="http://192.168.0.1/${NEWGUEST}.ks"
export PUBREPO="http://202.141.176.110/centos/6/os/x86_64/"
installer_cmd="virt-install --connect qemu:///system -n ${NEWGUEST} -r ${NEWGUEST_RAM} --vcpus=${NEWGUEST_CPU} \
--disk path=/dev/VMGroup/appbox-${NEWGUEST},size=4,bus=virtio \
--os-type linux --os-variant rhel6 --accelerate --graphics none \
--network=bridge:em1-br0 --hvm \
--extra-args=\"ks=${KS_PATH} text utf8 console=tty0 console=ttyS0,115200\" \
-l ${PUBREPO}"
echo $installer_cmd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment