Code Monkey home page Code Monkey logo

old-vm's Introduction

RancherVM

Package and run KVM images as Kubernetes pods, run at scale.

How It Works

RancherVM allows you to create VMs that run inside of Kubernetes pods, called VM Pods. A VM pod looks and feels like a regular pod. Inside of each VM pod, however, is a container running a virtual machine instance. You can package any QEMU/KVM image as a Docker image, distribute it using any Docker registry such as DockerHub, and run it on RancherVM.

RancherVM extends the Kubernetes API with Custom Resource Definitions, or CRDs. Users define a VirtualMachine CRD specification detailing what base image, how much compute resources and what keypairs are authorized to open an SSH session. A Kubernetes controller creates VM pods as necessary to achieve the desired specification and reflects this in the VirtualMachine CRD status.

RancherVM comes with a Web UI for managing public keys, compute nodes, virtual machines and accessing the VNC console from a web browser.

How it works

Deployment

Prerequisite

  1. Kubernetes v1.8+
  2. KVM has been installed on all nodes.
    1. Follow the distribution-specific instructions to ensure KVM works. We only require KVM to be enabled in the kernel. We do not need any user space tools like qemu-kvm or libvirt. On Ubuntu 16.04, you can make sure KVM is enabled by checking that both devices /dev/kvm and /dev/net/tun exist.
    2. An easy way to run KVM on your Windows or Mac laptop is to use nested virtualization with VMware Workstation or VMware Fusion. Just enable "Virtualize Intel VT-x/EPT or AMD-V/RVI" in VM settings. Remember to use Ubuntu 18.04 or CentOS with latest kernel in this case, otherwise you will hit bug that VM hanging from Booting from harddisk...
  3. All nodes must be in the same layer 2 network, with an existing DHCP server.
  4. Host bridge network has been prepared for RancherVM. See here for details.
    1. Identify your NIC name (e.g. ens33) on each host, and replace the value here
    2. Identify your bridge name (e.g. br0) on each host, then replace the value here and the line below contains br0.

Once you have Kubernetes and KVM both setup, and correctly setup the nic names, you can deploy the system:

kubectl create -f deploy/ranchervm.yaml

When you see all pods are ready and running as follows, you've deployed RancherVM successfully. Single-node Kubernetes clusters are expected to run fewer pods.

$ kubectl -n ranchervm-system get pods
NAME                             READY     STATUS    RESTARTS   AGE
backend-5f5dd7878-5p6rm          1/1       Running   0          1h
frontend-5b5d47c669-cnlwn        1/1       Running   0          1h
ip-controller-648cdf6854-gkvxj   2/2       Running   0          1h
vm-controller-7c5fdbb68d-d8qq8   1/1       Running   0          1h

RancherVM is ready to use. To access the UI, discover the endpoint as following.

$ kubectl -n ranchervm-system get svc/frontend
NAME       TYPE           CLUSTER-IP    EXTERNAL-IP       PORT(S)        AGE
frontend   LoadBalancer   10.43.55.38   100.200.200.123   80:31520/TCP   42m

If the Kubernetes Cluster supports creating LoadBalancer services, access RancherVM UI using the EXTERNAL-IP (100.200.200.123 in the case above) on port 80. Otherwise, access RancherVM UI using <node_ip>: (port is 31520 in the case above), where node_ip is the public IP address of any node in the Kubernetes cluster.

Access the UI for most of RancherVM functionalities.

Build VM Images

You can find instructions on how to build images, including Windows images, in the RancherVM Images document.

Networking

The details of how RancherVM configures network for the VM Pod is documented in RancherVM Networking.

Build from Source

To build a Docker image, run IMAGE=yes hack/build.sh.

To only build the binary for your local OS & ARCH, run hack/build.sh.

old-vm's People

Contributors

frots avatar ibuildthecloud avatar jdoucerain avatar jonathonreinhart avatar sebgoa avatar sheng-liang avatar yasker avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

old-vm's Issues

While stopped instance on RancherVM WebUI, the instance on WebUI disappeared

The following article on Rancher blog show the web UI of RancherVM, i found there are four action functions for each instance, such as: start/stop/delete/console.

http://rancher.com/introducing-ranchervm-package-and-run-virtual-machines-as-docker-containers/

But the reality is that if you stopped instance, the instance would be disappeared, i have never seen a delete button....

My machine is:
$ uname -a
Linux zgvm3 3.16.0-30-generic #40
14.04.1-Ubuntu SMP Thu Jan 15 17:43:14 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

$ sudo docker version
Client version: 1.7.0-dev
Client API version: 1.19
Go version (client): go1.4.2
Git commit (client): 15b4511
OS/Arch (client): linux/amd64
Server version: 1.7.0-dev
Server API version: 1.19
Go version (server): go1.4.2
Git commit (server): 15b4511
OS/Arch (server): linux/amd64

$ sudo docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
3042a47dd469 18 hours ago 188.3 MB
dockercore/docker latest cbf4d194aa88 28 hours ago 1.516 GB
rancher/server latest 5c9ca324d2a8 13 days ago 506.2 MB
rancher/ranchervm latest 58b342f56fd6 2 weeks ago 249.4 MB
rancher/vm-rancheros latest ea786fa28606 2 weeks ago 303.5 MB
ubuntu 14.04 07f8e8c5e660 4 weeks ago 188.3 MB

How to make NO_DHCP work?

Hi,

I have a dhcp server on the host's network, which works fine for physical machines.

I'd like my rancher VMs to have their network set by this dhcp server.

As documented, I tried to run a vm with :

docker run -d -e "RANCHER_VM=true" --cap-add NET_ADMIN -v /tmp/ranchervm:/ranchervm --device /dev/kvm:/dev/kvm -p 22 --device /dev/net/tun:/dev/net/tun -e "NO_DHCP=true" rancher/vm-ubuntu -m 1024 -smp 1 -k fr

But the vm won't get any IP.
(Running with the container internal dnsmasq works fine, but I'd like to get rid of it)

Did I miss anything?

Stop the container and Virtual Machines, can not modified CPU and MEMORYand disk parameter!

hi, first question, after the Virtual Machine starts, want to change the VM's CPU and memory, such as cpu core from 1 added 4-core, memory from 512MB added 1024MB, stop the VM later, you can not edit System io.rancher.vm .vcpu 1 and Systemio.rancher.vm.memory parameters, can improve the function, can not change these parameters are very difficult to use!
The second question, after a container instance starts, the container can not be modified CPU and memory parameters, even if the container is stopped, it can not be modified, it can not join the function,?can not change these parameters are very difficult to use!

Creating vm results in pending state and error in controller

Hey,
I've just setup a brand new installation of Kubernetes and RancherVM. I deployed the latest version a36f4ce and created a ubuntu-server vm through the web interface.
Since the creation it is stuck in a pending state.
As does the Kubernetes description of the vm say:

kubectl describe virtualmachines.vm.rancher.io test-vm
Name:         test-vm
Namespace:    
Labels:       <none>
Annotations:  <none>
API Version:  vm.rancher.io/v1alpha1
Kind:         VirtualMachine
Metadata:
  Creation Timestamp:  2018-08-25T21:19:23Z
  Finalizers:
    deletion.vm.rancher.io
  Generation:        1
  Resource Version:  28056
  Self Link:         /apis/vm.rancher.io/v1alpha1/virtualmachines/test-vm
  UID:               89aec1c3-a8ac-11e8-823a-c8f7337ecd45
Spec:
  Action:          start
  Cpus:            1
  Hosted _ Novnc:  false
  Image:           rancher/vm-ubuntu:16.04.4-server-amd64
  Memory _ Mb:     512
  Node _ Name:     
  Public _ Keys:
    james
Status:
  Id:              i-89aec1c3
  Ip:              
  Mac:             06:fe:89:ae:c1:c3
  Node _ Ip:       10.13.42.71
  Node _ Name:     wh84hs7idph
  State:           pending
  Vnc _ Endpoint:  
Events:            <none>

The controller did log an error message that the vm could not be updated:

W0825 21:19:23.456462       1 controller.go:279] error updating vm pod default/test-vm: Operation cannot be fulfilled on virtualmachines.vm.rancher.io "test-vm": the object has been modified; please apply your changes to the latest version and try again

I've not made any changes to the vm since clicking the create button in the webinterface, and my machine should have sufficient resources for creating a vm. Right now I'm kind of clueless what could cause this error and how to repair the system.
Any ideas? Or even a possible fix on my end?
Thanks,
Nicolai

ranchervm WebUI failing

This happens when attempting to reach the UI after booting the container on RancherOS v0.3.1

rancher@rancher:~$ docker run -v /run:/run -p 8081:80 -v /tmp/ranchervm:/ranchervm rancher/ranchervm

  • '[' '' = bash ']'
  • RANCHER_HOME=/var/lib/rancher
  • exec python /var/lib/rancher/noVNC-0.0.2/utils/websockify --web /var/lib/rancher/noVNC-0.0.2 --cert /var/lib/rancher/self.pem 80 --unix-target /ranchervm/vm
    WebSocket server settings:
    • Listen on :80
    • Flash security policy server
    • Web server. Web root: /var/lib/rancher/noVNC-0.0.2
    • SSL/TLS support
    • proxying from :80 to /ranchervm/vm

WARNING: no 'numpy' module, HyBi protocol will be slower
172.19.8.1 - - [17/Jun/2015 20:05:02] command: /var/lib/rancher/noVNC-0.0.2/cgi-bin/ranchervm ""
172.19.8.1 - - [17/Jun/2015 20:05:02] Traceback (most recent call last):
File "/var/lib/rancher/noVNC-0.0.2/cgi-bin/ranchervm", line 355, in
containers = {c.get("Id"): c for c in docker_client.containers(all=True)}
File "/usr/local/lib/python2.7/dist-packages/docker/client.py", line 440, in containers
res = self._result(self._get(u, params=params), True)
File "/usr/local/lib/python2.7/dist-packages/docker/client.py", line 106, in _get
return self.get(url, *_self._set_request_timeout(kwargs))
File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 477, in get
return self.request('GET', url, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 465, in request
resp = self.send(prep, *_send_kwargs)
File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 573, in send
r = adapter.send(request, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/requests/adapters.py", line 415, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', error(111, 'Connection refused'))

172.19.8.1 - - [17/Jun/2015 20:05:02] CGI script exit status 0x1
172.19.8.1: ignoring socket not ready
172.19.8.1: ignoring socket not ready

Kubernetes deployment yields errors in the UI.

Deploying to kubernetes yields javascript errors in the UI.

uncaught at t TypeError: Cannot read property 'length' of null
    at o (http://ranchervm.k8s.ajroney.com/0.dashboard.js:10:26555)
    at r.render (http://ranchervm.k8s.ajroney.com/index.js:32:19614)
    at c._renderValidatedComponentWithoutOwnerOrContext (http://ranchervm.k8s.ajroney.com/index.js:32:26093)
    at c._renderValidatedComponent (http://ranchervm.k8s.ajroney.com/index.js:32:26305)
    at c._updateRenderedComponent (http://ranchervm.k8s.ajroney.com/index.js:32:25520)
    at c._performComponentUpdate (http://ranchervm.k8s.ajroney.com/index.js:32:25321)
    at c.updateComponent (http://ranchervm.k8s.ajroney.com/index.js:32:24599)
    at c.receiveComponent (http://ranchervm.k8s.ajroney.com/index.js:32:23710)
    at Object.receiveComponent (http://ranchervm.k8s.ajroney.com/index.js:5:30860)
    at c._updateRenderedComponent (http://ranchervm.k8s.ajroney.com/index.js:32:25564)

Any idea what might be going on?

can't use the console

Hi,
I use the rancherVM , but when i created some instances,
i can't find how to use console
2016-01-08 15 51 47

Enhancement: List available images

With Docker 1.6 (rc is available at https://test.docker.com/builds/Linux/x86_64/docker-1.6.0-rc4) adds support for labels on images. You could add to the vm base image a tag like below in the Dockerfile

LABEL io.rancher.vm.image=true

Then all images that are built from the base will have that label. You could then list the available vm images by doing docker images -f label=io.rancher.vm.image=true. You could then have a nice drop down in the UI of images available (in addition to a free form text box)

Error provisioning a rancher/vm-rancheros

Running rancher/server:v1.0.0 and rancher/agent:v0.11.0 on rancher-os v0.4.3 (bare metal)

Log from rancher/vm-rancheros that failed to launch

29/03/2016 21:14:57 dnsmasq: bad dhcp-range at line 2 of /etc/dnsmasq.conf
29/03/2016 21:14:57 /var/lib/rancher/startvm: line 99: let: NEWCIDR=16
29/03/2016 21:14:57 16-1: syntax error in expression (error token is "16-1")
29/03/2016 21:14:57 /var/lib/rancher/startvm: line 123: let: i=2886795269^(1<<16
29/03/2016 21:14:57 16): missing `)' (error token is "16)")
29/03/2016 21:14:57 Error: either "local" is duplicate, or "10.42.0.169/16" is a garbage.
29/03/2016 21:14:57 Could not initialize SDL(No available video device) - exiting

VNC console link not shown in GUI

(This is with docker 17.09.0~ce-0~ubuntu under Ubuntu 16.04)

I start RancherVM management GUI as per instructions - except on a different port since I'm already using 8080 for rancher:

docker run -v /var/run:/var/run -p 8123:80 -v /var/lib/rancher/vm:/vm rancher/ranchervm

Then I connect to <dockerhost>:8123, click on "create instance", and the instance is created fine. However in the instance listing, there is no option to connect to its console; only "Stop" is offered.

image

But the article shows that I should see a "Console" link for running containers:

documentation image

If I look inside the container:

# docker exec -it reverent_heisenberg bash
root@i-775071e0:/# ps auxwww
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  6.1 17.9 1906472 275416 ?      Ssl  18:37   2:31 qemu-system-x86_64 -enable-kvm -vnc unix:/ranchervm/vm/ac20250faf208407634ba92d8af5055df4ec1662c5310b82952a43709f6b339c/vnc -drive file=/image/sda.qcow2,if=none,id=drive-disk0,format=qcow2 -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x6,drive=drive-disk0,id=virtio-disk0,bootindex=1 -netdev bridge,br=br0,id=net0 -device virtio-net-pci,netdev=net0,mac=02:42:ac:11:00:06 -m 512m -smp 1
root        36  0.0  0.0  28208  1512 ?        S    18:37   0:00 dnsmasq
root       104  0.0  0.2  18176  3160 pts/0    Ss+  19:13   0:00 bash
root       151  2.5  0.1  18168  2996 pts/1    Ss   19:18   0:00 bash
root       165  0.0  0.1  15568  1904 pts/1    R+   19:18   0:00 ps auxwww
root@i-775071e0:/# ls -l /ranchervm/vm/ac20250faf208407634ba92d8af5055df4ec1662c5310b82952a43709f6b339c/vnc
srwxr-xr-x 1 root root 0 Nov 19 18:37 /ranchervm/vm/ac20250faf208407634ba92d8af5055df4ec1662c5310b82952a43709f6b339c/vnc

... I see that the VNC socket is being written under a path under /ranchervm. However, this path is not accessible to the management container as far as I can tell.

# docker container inspect reverent_heisenberg
...
        "Mounts": [
            {
                "Type": "volume",
                "Name": "4e7ea731ea95dab78cf8345b2f45c1e7743170cb447b27845f98b8aed2ed7cbb",
                "Source": "/var/lib/docker/volumes/4e7ea731ea95dab78cf8345b2f45c1e7743170cb447b27845f98b8aed2ed7cbb/_data",
                "Destination": "/ranchervm",
                "Driver": "local",
                "Mode": "",
                "RW": true,
                "Propagation": ""
            },
            {
                "Type": "volume",
                "Name": "a13f195bf8ef0413a79f709db0afb3dabf62b83b4bdcde5e36d8677991d160ae",
                "Source": "/var/lib/docker/volumes/a13f195bf8ef0413a79f709db0afb3dabf62b83b4bdcde5e36d8677991d160ae/_data",
                "Destination": "/image",
                "Driver": "local",
                "Mode": "",
                "RW": true,
                "Propagation": ""
            },
            {
                "Type": "bind",
                "Source": "/var/run",
                "Destination": "/var/run",
                "Mode": "",
                "RW": true,
                "Propagation": "rprivate"
            },
            {
                "Type": "bind",
                "Source": "/var/lib/rancher/vm",
                "Destination": "/vm",
                "Mode": "",
                "RW": true,
                "Propagation": "rprivate"
            }
        ],

That is, the path /ranchervm is in its own, randomly-named docker volume. The directory /vm, which is shared between the management container and the VM container (and is /var/lib/rancher/vm on the host), is empty.

Any suggestions for where I should look?

VM Pod creation fails (Target interface does not exist)

Hi all,

I am using RancherVM but I can't start any VMs, since there is always an error during the creation of the pod. This is the output of kubectl logs for one of my VM pods: logs.txt
At the very end it reports that Target interface ens33 does not exist. How can I fix that?

I am running k8s version 1.10.3 on Ubuntu 16.04 btw.

Thanks for having a look!
Ulrich

Lxd support

Any chance of ranchervm supporting lxd. I think lxd is the new way of thinking hypervisor. It will be nice if rancher supports lxd

Document how to customize VMs via the command line

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.

Failed to pull local image

When I build a image locally, I try to use that image in virtualmachine spec, I got the error from pod events:

Failed to pull image "my-local-image:tag": rpc error: code = Unknown desc = Error response from daemon: pull access denied for rancher-ubuntu, repository does not exist or may require 'docker login'

Is this because of the ImagePullPolicy = Always of pod? If yes, can you provide a way to change that default value? Thx.

https://github.com/rancher/vm/blob/f40cd374902cacf17dee43950586d8af836bbb58/pkg/controller/vm/util.go#L173

mgmt will not pull images

If you put in an image from a registry that needs to be pulled, the manager code will not pull it. When you create a container from the Docker API it will return 404 when the image is not found. You need to then try to pull the image and create the VM again.

Deploying Windows application in Nvidia Docker

I am planning to containerize legacy gpu intensive windows application using Nvidia Docker and kubernetis. But nvidia docker doesn't support windows as of now. please suggest some ideas. can I use RancherVM?

noVNC

You should give the noVNC guys some credit in the readme.

:)

Tutorial on how to create vm container images

Is there going to be a tutorial on how to create vm container images, I got the image file created and I see the instructions on how to create the docker file to create the container, but where is the docker file placed in?, is there a specific directory, how does ranchervm know where to add that image to the ui, the instructions seem very light on how the whole process works.

VM in container fails to connect outside under RancherOS(host OS)

Case 1:
RancherOS(host OS)+rancher/vm-rancheros
Cmd: same as document described, it is 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
Result: device eth0 in VM cant not obtain ip address from DHCP server, even if manually config eth0 and ip route, still cann't ping bridge docker0

Case 2:
RancherOS(host OS)+rnd-dockerhub.huawei.com/library/rancher-vm-ubuntu:14.04, rnd-dockerhub.huawei.com/library/rancher-vm-ubuntu:14.04 is almost same as rancher/vm-ubuntu, just change id/pwd for ubuntu os image
Cmd: same as document described, it is 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 rnd-dockerhub.huawei.com/library/rancher-vm-ubuntu:14.04
Result: same as Case 1

Case 3:
Ubuntu(host OS)+rancher/vm-rancheros
Cmd: same as document described, it is 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
Result: network of VM in container works

[Question] Running first VM container

Hi,

I'm new to KVM and Rancher VM, so I'm just following README on https://github.com/rancher/vm. Maybe you can help me to get started?

rancher/ranchervm:0.0.2 starts and Rancher VM UI becomes available. However starting rancher/vm-rancheros:latest fails with docker: Error response from daemon: linux runtime spec devices: error gathering device information while adding custom device "/dev/kvm": lstat /dev/kvm: no such file or directory. The Created instance appears in UI and attempts to start it result in the same error message.

  • /dev/kvm does not get created on the host. Where is /dev/kvm expected?
  • how can installation of KVM be tested? Is yum -y install kvm virt-manager libvirt libvirt-python python-virtinst sufficient?

I have to test Rancher VM on Oracle Linux. Actually the entire setup can be seen on https://github.com/sadovnikov/redhot-erp/tree/master/vagrant/oracle-linux-ranchervm

Do you see anything preventing VM Container to start?

Thank you in advance,
Viktor

Ubuntu image SSH is broken

On the Ubuntu image sshd has no host keys. I have not investigated why but I assume some "firstboot" flag is not set to generate the keys.

BBVA/kvm: Partially based on RancherVM project

Found that great project which looks like a improved RancherVM.

Generic container for launching a Virtual Machine inside a Docker container.
Features:

  • uses QEMU/KVM to launch the VM directly with PID 1.
  • Non libvirt dependant.
  • It attaches to the VM as many NICs as the docker container has.
  • The VM gets the original container IPs. The container gets non-conflicting IPs
  • Uses macvtap tun devices for best network throughput

Maybe RancherVM could be improved with some of the features (interface mapping, ...) from BBVA/kvm?

TypeError: 'NoneType' object is not iterable

It happens whenever I hit the web interface in port 8080 (blank screen is displayed in browser).

I'm running docker 1.6.1 in ubuntu 15.04 (physical). kvm-ok reports virtualization enabled. Started the container with your suggested command line:
docker run -v /var/run/docker.sock:/var/run/docker.sock -p 8080:80 -v /tmp/ranchervm:/ranchervm rancher/ranchervm

Startup log:

WebSocket server settings:

  • Listen on :80
  • Flash security policy server
  • Web server. Web root: /var/lib/rancher/noVNC-0.0.2
  • SSL/TLS support
  • proxying from :80 to /ranchervm/vm
    WARNING: no 'numpy' module, HyBi protocol will be slower

This is the whole exception stacktrace:

10.3.2.133 - - [12/May/2015 09:24:31] command: /var/lib/rancher/noVNC-0.0.2/cgi-bin/ranchervm ""
10.3.2.133 - - [12/May/2015 09:24:32] Traceback (most recent call last):
File "/var/lib/rancher/noVNC-0.0.2/cgi-bin/ranchervm", line 362, in
[id for id in containers.keys()])),
File "/var/lib/rancher/noVNC-0.0.2/cgi-bin/ranchervm", line 360, in
c.get("Config").get("Env")) != [],
TypeError: 'NoneType' object is not iterable

10.3.2.133 - - [12/May/2015 09:24:32] CGI script exit status 0x1

Question: Current storage solution

I know there are plans to move the storage part of the KVM VMs to a block storage based system.
But since that feature is (probably?) not implemented yet, I'm wondering what the current solution is?
Are the drive images for the VMs just on the host's main partition?
Thanks for your answers in advance!

kvm dose not get ip

Hi guys.
There is a problem that KVM dose not get IP. This is the scenario:
As you know KVM gets ip from dnsmasq and dhcp packets comes from br0 to dnsmasq. Now if the IP of br0 interface dose not exist in range of the lease dnsmasq gives kvm, dnsmasq dose not release the lease. read here

And also as you know there is a algorithm in startvm script which generates an IP for br0. Now the problem is that the generated IP sometimes is not in the range of KVM IP.

Look this is the code which generates IP for br0:

    let "NEWCIDR=$CIDR-1"
    #NEWNETMASK=`cidr2mask $NEWCIDR`

    i=`atoi $IP`
    let "i=$i^(1<<$CIDR)"
    NEWIP=`itoa i`

And this little change fixes anything:

    let "NEWCIDR=$CIDR-1"
    #NEWNETMASK=`cidr2mask $NEWCIDR`

    i=`atoi $IP`
    let "i=$i^(1<<(32-$CIDR))"
    NEWIP=`itoa i`

Let me know if I am correct :)

Better integration of ranchervm containers with rancher web gui?

An integration of ranchervm web gui with rancher web gui would be great.
Is an integration planned?

Use create, delete, start, stop and console ranchervm features inside of rancher web gui? For example as an additional tab "virtual machines". rancher should use container machine name instead of a random generated name.

Using custom VM images is currently impossible

The VM controller always prefixes images with vm.Spec.MachineImage (defined as the constant rancher/vm-%s). This prevents the use of custom machine images.

https://github.com/rancher/vm/blob/62fde3566e8ed2822d514dc9bc9c9a184f249608/pkg/common/constants.go#L11

https://github.com/rancher/vm/blob/f0b2f2cd700f7273ea9f6ccb10ca4f05a4130779/pkg/controller/vm/util.go#L71

Also, the UI has the sample images hard-coded, and depends on the convention above

https://github.com/LLParse/longhorn-ui/blob/748012e17124d95a41efb290ddfb111550b55d1b/src/routes/instances/CreateInstance.js#L98-L106

android image not available from S3

the build fails while trying to grab the image for android:

Does not seem that permissions are correct on:

https://s3-us-west-1.amazonaws.com/sheng/qcow2/android-4.4-r2.gz.qcow2

Using GPU

Is GPU supported when create new VM instance?

How to stop ranchervm management server?

I started the server container using

docker run --cap-add NET_ADMIN -v /var/run/docker.sock:/var/run/docker.sock -p 8080:80 rancher/vmmgmt:0.0.1

I can only stop it using kill -9

No address range available for DHCP request

Hello

I try to get work the Metasploitable2 image following the documentation about creating them. However, when I launch it, the VM can't obtain a IP address from the dnsmasq.

# dnsmasq -d
dnsmasq: started, version 2.68 cachesize 150
dnsmasq: compile time options: IPv6 GNU-getopt DBus i18n IDN DHCP DHCPv6 no-Lua TFTP conntrack ipset auth
dnsmasq-dhcp: DHCP, IP range 192.168.251.111 -- 192.168.251.111, lease time 1h
dnsmasq: reading /etc/resolv.conf
dnsmasq: using nameserver 127.0.0.11#53
dnsmasq: read /etc/hosts - 7 addresses
dnsmasq-dhcp: no address range available for DHCP request via br0
dnsmasq-dhcp: no address range available for DHCP request via br0
dnsmasq-dhcp: no address range available for DHCP request via br0

And my Docker compose definition:

  um_metasploitable2:
    image: vk496/metasploitable2
    hostname: metasploitable2
    volumes:
        - /var/lib/rancher/vm:/vm
    cap_add:
        - NET_ADMIN
    devices:
        - /dev/kvm:/dev/kvm
        - /dev/net/tun:/dev/net/tun
    networks:
        red1:
            aliases:
                - metasploitable2.bar.foo
            ipv4_address: 192.168.251.111

Reading in the internet, says that the problem is the IP address of the interface where is serverd. My subnet in Docker Compose is 192.168.251.0/24 but the br0 interface has the following:

root@metasploitable2:/# ifconfig 
br0       Link encap:Ethernet  HWaddr 06:fe:0d:c6:91:de  
          inet addr:193.168.251.111  Bcast:0.0.0.0  Mask:255.255.254.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:99 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:27637 (27.6 KB)  TX bytes:0 (0.0 B)

eth0      Link encap:Ethernet  HWaddr 06:fe:0d:c6:91:de  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:100 errors:0 dropped:0 overruns:0 frame:0
          TX packets:43 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:24071 (24.0 KB)  TX bytes:9666 (9.6 KB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:24 errors:0 dropped:0 overruns:0 frame:0
          TX packets:24 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2322 (2.3 KB)  TX bytes:2322 (2.3 KB)

tap0      Link encap:Ethernet  HWaddr fe:02:28:a2:f6:ce  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:30 errors:0 dropped:0 overruns:0 frame:0
          TX packets:70 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:8676 (8.6 KB)  TX bytes:20321 (20.3 KB)

If I change the IP address of br0 to one that is in the range, it works and the VM get a IP over DHCP. I read that the option bridge-interface of dnsmasq ignore the IP address of the interface X in favour of other interface, but didn't found anything to ignore completly this behavior.

How it's possible that no previous issues about this?

Salu2

Is it possible to do bridged networking under Rancher OS?

Running Rancher OS on a large dedicated server with multiple IPs. I was hoping to spin up several Rancher VMs on these separate IPs, route all ports to them via:

docker run -p <some IP>:1-65535:1-65535 -p <some IP>:1-65535:1-65535/udp my/vm

This works if I use individual ports, but I can't use ranges. I even tried adding an EXPOSE for all ports, but that locked up my docker daemon until I removed the offending container.

The docs include instructions for bridging to the host network, but they're written for Ubuntu. Is there any way to achieve this configuration via ros? Or is there some other creative way to do this? Maybe I should run a more traditional OS on the root server and Rancher OS on the individual Rancher host VMs, though I'd really like to keep my OS selection uniform if at all possible.

Live migration for the ranchervm

I was just feeling that live migration feature should be added in the ranchervm manager or even the rancher server itself. since some people may want to use ranchervm as rancher hosts to run their application stack containers.
Thinking about it , create a service that will be spinning out virtual machine hosts for another application stack to be consuming the hosts as it scales.
Then for maintenance purposes you will migrate the vm hosts to another physical hosts without interrupting the services in the application stacks.

novnc broke

I ran docker run -v /var/run:/var/run -p 8080:80 -v /var/lib/rancher/vm:/vm rancher/ranchervm and tried accessing the VNC in the browser. The page on port 8080 failed to render anything useful and I found this in the container logs:

172.16.88.1 - - [14/Jan/2016 15:35:08] CGI script exit status 0x1
172.16.88.1 - - [14/Jan/2016 15:35:37] command: /var/lib/rancher/noVNC-0.0.2/cgi-bin/ranchervm ""
172.16.88.1 - - [14/Jan/2016 15:35:37] Traceback (most recent call last):
  File "/var/lib/rancher/noVNC-0.0.2/cgi-bin/ranchervm", line 359, in <module>
    containers = {c.get("Id"): c for c in docker_client.containers(all=True)}
  File "/usr/local/lib/python2.7/dist-packages/docker/api/container.py", line 68, in containers
    res = self._result(self._get(u, params=params), True)
  File "/usr/local/lib/python2.7/dist-packages/docker/client.py", line 146, in _result
    self._raise_for_status(response)
  File "/usr/local/lib/python2.7/dist-packages/docker/client.py", line 142, in _raise_for_status
    raise errors.APIError(e, response, explanation=explanation)
docker.errors.APIError: 400 Client Error: Bad Request ("client is newer than server (client API version: 1.21, server API version: 1.20)")

The ip and ports of stopped instance still display on RancherVM Web UI in abnormal scene

I had mentioned this issue in #42

but now i find how to reproduce it.

step1, create and start a instance

step2, kill docker process or restart host os

step3, start docker and ranchervm

The instance which is up status in step1, its ip and ports still display on web ui, but it is down status, such as following pic:
ranchervm_2

I read the code of this file: vm/mgmt/ranchervm, docker object contain the value of ip and ports, so maybe there was same cahe or temp file which record the ip and ports not been deleted while docker service killed?

if not, i think we can workaroud this issue.

if status.startswith("Up"):
.......
else:
ip = ""
ports = ""

PS: my machine env is,
zhaoguang@zgvm3:/tmp$ uname -a
Linux zgvm3 3.16.0-30-generic #40~14.04.1-Ubuntu SMP Thu Jan 15 17:43:14 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
zhaoguang@zgvm3:/tmp$ sudo docker version
Client version: 1.6.2
Client API version: 1.18
Go version (client): go1.4.2
Git commit (client): 7c8fca2
OS/Arch (client): linux/amd64
Server version: 1.6.2
Server API version: 1.18
Go version (server): go1.4.2
Git commit (server): 7c8fca2
OS/Arch (server): linux/amd64
zhaoguang@zgvm3:/tmp$

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.