Skip to content

Instantly share code, notes, and snippets.

@cwebberOps
Created October 23, 2012 14:45
Show Gist options
  • Save cwebberOps/3939188 to your computer and use it in GitHub Desktop.
Save cwebberOps/3939188 to your computer and use it in GitHub Desktop.
vminst
#!/bin/bash
ip=138.23.
netmask=255.255.255.128
gateway=138.23
preseed_host=
vm_name=lb-1.bioinfo.ucr.edu
ds_name=ds-local
ram=512
mkdir /srv/${ds_name}/${vm_name}
virt-install \
--connect qemu:///system \
--name ${vm_name} \
--ram ${ram} \
--os-type=linux \
--os-variant=debianwheezy \
--disk=/srv/${ds_name}/${vm_name}/disk0,size=20,sparse=true \
-w bridge=br_public \
-w bridge=br_clust \
--extra-args="console=tty0 console=ttyS0,115200n8 auto=true priority=critical locale=en_US url=http://${preseed_host}/preseed.kvm netcfg/choose_interface=eth0 netcfg/get_nameservers=138.23. netcfg/get_ipaddress=${ip} netcfg/get_netmask=${netmask} netcfg/get_gateway=${gateway} netcfg/disable_dhcp=true" \
--location http://http.debian.net/debian/dists/wheezy/main/installer-amd64 \
--initrd-inject=/srv/config/${vm_name}/interfaces \
--autostart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment