This repository has been archived on 2020-03-24. You can view files and clone it, but cannot push or open issues or pull requests.
quay/buildman/qemu-coreos/start.sh

27 lines
719 B
Bash
Raw Normal View History

2015-11-20 20:32:32 +00:00
#!/bin/bash
2016-08-31 19:49:21 +00:00
VM_VOLUME_SIZE="${VM_VOLUME_SIZE:-32G}"
2016-09-29 15:20:49 +00:00
VM_MEMORY="${VM_MEMORY:-4G}"
2016-08-31 19:49:21 +00:00
2015-11-20 20:32:32 +00:00
set -e
set -x
set -o nounset
mkdir -p /userdata/openstack/latest
2016-08-31 19:49:21 +00:00
echo "${USERDATA}" > /userdata/openstack/latest/user_data
2015-11-20 20:32:32 +00:00
time qemu-img resize ./coreos_production_qemu_image.img "${VM_VOLUME_SIZE}"
2015-11-20 20:32:32 +00:00
qemu-system-x86_64 \
-enable-kvm \
-cpu host \
-device virtio-9p-pci,fsdev=conf,mount_tag=config-2 \
-nographic \
-drive if=virtio,file=./coreos_production_qemu_image.img \
-fsdev local,id=conf,security_model=none,readonly,path=/userdata \
-m "${VM_MEMORY}" \
-machine accel=kvm \
-net nic,model=virtio \
-net user,hostfwd=tcp::2222-:22 \
-smp 2