parameterize ram/cores in build_kvm

This commit is contained in:
Jesse Andrews 2011-10-20 14:57:18 -07:00
parent 6993746cac
commit 6960eff979

View File

@ -162,13 +162,15 @@ CONTAINER_CIDR=${CONTAINER_CIDR:-$CONTAINER_IP/24}
CONTAINER_NETMASK=${CONTAINER_NETMASK:-255.255.255.0} CONTAINER_NETMASK=${CONTAINER_NETMASK:-255.255.255.0}
CONTAINER_GATEWAY=${CONTAINER_GATEWAY:-192.168.1.1} CONTAINER_GATEWAY=${CONTAINER_GATEWAY:-192.168.1.1}
CONTAINER_MAC=${CONTAINER_MAC:-"02:16:3e:07:69:`printf '%02X' $(echo $CONTAINER_IP | sed "s/.*\.//")`"} CONTAINER_MAC=${CONTAINER_MAC:-"02:16:3e:07:69:`printf '%02X' $(echo $CONTAINER_IP | sed "s/.*\.//")`"}
CONTAINER_RAM=${CONTAINER_RAM:-1524288}
CONTAINER_CORES=${CONTAINER_CORES:-1}
# libvirt.xml configuration # libvirt.xml configuration
LIBVIRT_XML=libvirt.xml LIBVIRT_XML=libvirt.xml
cat > $LIBVIRT_XML <<EOF cat > $LIBVIRT_XML <<EOF
<domain type='kvm'> <domain type='kvm'>
<name>$CONTAINER_NAME</name> <name>$CONTAINER_NAME</name>
<memory>1524288</memory> <memory>$CONTAINER_RAM</memory>
<os> <os>
<type>hvm</type> <type>hvm</type>
<bootmenu enable='yes'/> <bootmenu enable='yes'/>
@ -176,7 +178,7 @@ cat > $LIBVIRT_XML <<EOF
<features> <features>
<acpi/> <acpi/>
</features> </features>
<vcpu>1</vcpu> <vcpu>$CONTAINER_CORES</vcpu>
<devices> <devices>
<disk type='file'> <disk type='file'>
<driver type='qcow2'/> <driver type='qcow2'/>