Open ndarilek opened 8 years ago
All docker command line arguments are passed to kvm command line. You can specify memory size and CPU count as follows:
docker run -e "RANCHER_VM=true" --cap-add NET_ADMIN -v \
/tmp/ranchervm:/ranchervm --device /dev/kvm:/dev/kvm \
--device /dev/net/tun:/dev/net/tun rancher/vm-rancheros -m 512m -smp 1
To change the disk size, you need to create a new VM base image that is larger. We would potentially create an option to enable the VM to mount a second disk of arbitrary size. That will require some code change in the startvm script.
Ah, so to resize the disk, I have to grab the original VM image, resize it and build my own image from that?
Thanks.
Yes. I should have made the original qcow2 base larger. You now need to resize qcow and then resize the file system inside it. Not a trivial task.
Would it be possible for kvm to send keys to the guest vm? Take the docker command line arguments, feed them as keystrokes to the guest vm? Running a particular application with specified arguments within the guest vm would be useful.
@sheng-liang I realize this project hasn't been touched in a while, but what would the amount of effort be to update this to either include an option on the command line to set the disk size or include the option on the management page?
We are revamping the project now to make it work on a cluster of servers (powered by Kubernetes) and bring in many new features like clustered storage, VLAN networking, etc. Stay tuned!
I'd like to spin up VMs with custom memory limits and disk sizes. I'm also trying to do so via the command line, or more accurately, by docker-compose. It seems like the web interface supports at least memory limits. Is this at all possible from the command line? In particular I'd like to resize my VM's disk.
Thanks.