{"id":1346,"date":"2019-02-18T16:33:58","date_gmt":"2019-02-18T16:33:58","guid":{"rendered":"https:\/\/www.appservgrid.com\/paw93\/?p=1346"},"modified":"2019-03-07T20:06:34","modified_gmt":"2019-03-07T20:06:34","slug":"vm-container-introducing-ranchervm","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw93\/index.php\/2019\/02\/18\/vm-container-introducing-ranchervm\/","title":{"rendered":"VM Container | Introducing RancherVM"},"content":{"rendered":"<h5>Expert Training in Kubernetes and Rancher<\/h5>\n<p>Join our free online training sessions to learn more about Kubernetes, containers, and Rancher.<\/p>\n<p>Virtual machines and containers are two of my favorite technologies. I<br \/>\nhave always wondered about different ways they can work together. It has<br \/>\nbecome clear over time these two technologies compliment each other.<br \/>\nTrue there is overlap, but most people who are running containers today<br \/>\nrun them on virtual machines, and for good reason. Virtual machines<br \/>\nprovide the underlying computing resources and are typically managed by<br \/>\nthe IT operations teams. Containers, on the other hand, are managed by<br \/>\napplication developers and devops teams. I always thought this was a<br \/>\ngood approach, and that for most use cases containers would reside<br \/>\ninside virtual machines. Then, a few months ago, a meeting with Jeremy<br \/>\nHuylebroeck of Orange Silicon Valley changed my thinking. Jeremy<br \/>\nmentioned it might make sense to run virtual machines <em>inside<\/em><br \/>\ncontainers. At first the concept seemed odd. But the more I thought<br \/>\nabout it the more I saw its merit. Interestingly numerous use cases for<br \/>\nVM containers started to appear in our conversations with Rancher<br \/>\nusers. We have heard three common use cases for VM containers:<\/p>\n<ol>\n<li>Isolation and security. The first reason one might want to run<br \/>\nVM containers is to retain the isolation and security properties of<br \/>\nvirtual machines while still being able to package and distribute<br \/>\nsoftware as Docker containers. Despite the great deal of progress in<br \/>\ncontainer security, virtual machines are still better at isolating<br \/>\nworkloads. Compared with hundreds of Linux kernel interfaces,<br \/>\nvirtual machines have a smaller surface area (CPU, memory,<br \/>\nnetworking and storage interfaces) to protect. It is thus not<br \/>\nsurprising that folks who want to host untrusted workloads (for<br \/>\nexample, managed hosting companies and continuous integration<br \/>\nservices) have expressed interest in continuing to use virtual<br \/>\nmachines.<\/li>\n<li>Docker on-boarding. On-boarding existing workloads is always a<br \/>\nchallenge for organizations starting to adopt container<br \/>\ntechnologies. This is a second interesting use case for VM<br \/>\ncontainers, as they offer a useful transition path. For example,<br \/>\nwhile we expect a future version of Windows to support Docker<br \/>\ncontainers natively, VM containers can enable organizations to run<br \/>\nexisting Windows virtual machines on the same infrastructure built<br \/>\nfor Linux containers today. The same approach applies to other<br \/>\nnon-Linux operating systems and older version of Linux operating<br \/>\nsystems or application packages that have not yet been<br \/>\ncontainerized.<\/li>\n<li>KVM management. We have also seen a great deal of interest in<br \/>\nbetter management tools for open source virtualization technologies<br \/>\nlike KVM. At its core, KVM is solid. It is reliable and efficient.<br \/>\nHowever, KVM lacks the rich management tools in vSphere that IT<br \/>\noperations teams love. KVM can benefit from Docker, which offers a<br \/>\nsuperb experience for application developers and devops teams. If<br \/>\nKVM runs inside Docker containers, the resulting VM container can<br \/>\nretain the security, reliability, and efficiency of KVM, while<br \/>\noffering the Docker management experience devops teams love. The<br \/>\nability to package virtual machines as Docker images and distribute<br \/>\nthem through Docker Hub is valuable. Powerful service discovery<br \/>\nmechanisms developed for containers can now apply to virtual<br \/>\nmachines. Native container management systems like Rancher can now<br \/>\nbe used to manage virtual machine workloads at large scale.<\/li>\n<\/ol>\n<p>Because of all of these use cases, I started experimenting with running<br \/>\nKVM inside Docker containers, and I have come up with an experimental<br \/>\nsystem called RancherVM. RancherVM allows you to package KVM images<br \/>\ninside Docker images and manage VM containers using the familiar Docker<br \/>\ncommands. A VM container looks and feels like a regular container. It<br \/>\ncan be created from Dockerfile, distributed using DockerHub, managed<br \/>\nusing docker command line, and networked together using links and port<br \/>\nbindings. Inside each VM container, however, is a virtual machine<br \/>\ninstance. You can package any QEMU\/KVM image as RancherVM containers.<br \/>\nRancherVM accomplishes all this without introducing any performance<br \/>\noverhead against running KVM without containers. <img decoding=\"async\" src=\"http:\/\/cdn.rancher.com\/wp-content\/uploads\/2015\/04\/17053553\/ranchervm.png\" alt=\"How RancherVM\nWorks\" \/> RancherVM additionally comes with a<br \/>\nmanagement container that provides a web UI for managing virtual<br \/>\nmachines. The following command starts the RancherVM management<br \/>\ncontainer on a server where Docker and KVM are installed:<\/p>\n<p>docker run -v \/var\/run\/docker.sock:\/var\/run\/docker.sock -p 8080:80 -v \/tmp\/ranchervm:\/ranchervm rancher\/ranchervm<\/p>\n<p>Once the management container is up, you can access a web-based virtual<br \/>\nmachine management experience for VM containers at<br \/>\nhttps:\/\/&lt;kvmhost&gt;:8080\/:<br \/>\n<img decoding=\"async\" src=\"http:\/\/cdn.rancher.com\/wp-content\/uploads\/2015\/04\/17053553\/RancherVM-Mgmt.png\" alt=\"RancherVM-Mgmt\" \/> The web-based UI allows you to perform basic life-cycle<br \/>\noperations for VM containers and access the VNC console for virtual<br \/>\nmachines. VNC console access comes in handy when you need to perform<br \/>\noperations that cannot be performed with remote SSH or RDP, such as<br \/>\ntroubleshooting a Windows VM\u2019s network configuration:<br \/>\n<img decoding=\"async\" src=\"http:\/\/cdn.rancher.com\/wp-content\/uploads\/2015\/04\/17053553\/RancherVM-Windows.png\" alt=\"RancherVM-Windows\" \/> The web UI experience is attractive for users familiar<br \/>\nwith VM management tools. A great benefit of RancherVM vs. traditional<br \/>\nVM management is we can now use the powerful Docker command lines to<br \/>\nmanage virtual machines. The following command, for example, starts a<br \/>\nRancherOS VM:<\/p>\n<p>docker run -e &#8220;RANCHER_VM=true&#8221; &#8211;cap-add NET_ADMIN -v \/tmp\/ranchervm:\/ranchervm &#8211;device \/dev\/kvm:\/dev\/kvm &#8211;device \/dev\/net\/tun:\/dev\/net\/tun rancher\/vm-rancheros<\/p>\n<p>Other than some command-line options required to setup a Docker<br \/>\ncontainer to host KVM, this is just a normal docker command used to<br \/>\ninstantiate a container image called rancher\/vm-rancheros. Additional<br \/>\ndocker commands like docker stop, docker ps, docker images, and<br \/>\ndocker inspect all work as expected. The following video shows the<br \/>\nlive experience of using RancherVM.<\/p>\n<p>Today we\u2019re making RancherVM available on<br \/>\n<a href=\"http:\/\/github.com\/rancherio\/vm\">GitHub<\/a>. I hope the initial release of<br \/>\nRancherVM gives you some ideas about building and using VM containers.<br \/>\nIf you are interested, please check out the demo video, download the<br \/>\nsoftware, and create some VM containers for yourself. If you have any<br \/>\nquestions or issues, please file them as issues in GitHub and we\u2019ll<br \/>\nrespond as quickly as possible. On May 13th we will be hosting an online<br \/>\nmeetup to demonstrate RancherVM, show a few use cases, and answer any<br \/>\nquestions you might have. Please register to attend below.<\/p>\n<p><a href=\"https:\/\/rancher.com\/introducing-ranchervm-package-and-run-virtual-machines-as-docker-containers\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Expert Training in Kubernetes and Rancher Join our free online training sessions to learn more about Kubernetes, containers, and Rancher. Virtual machines and containers are two of my favorite technologies. I have always wondered about different ways they can work together. It has become clear over time these two technologies compliment each other. True there &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw93\/index.php\/2019\/02\/18\/vm-container-introducing-ranchervm\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;VM Container | Introducing RancherVM&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-1346","post","type-post","status-publish","format-standard","hentry","category-kubernetes"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw93\/index.php\/wp-json\/wp\/v2\/posts\/1346","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw93\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw93\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw93\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw93\/index.php\/wp-json\/wp\/v2\/comments?post=1346"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw93\/index.php\/wp-json\/wp\/v2\/posts\/1346\/revisions"}],"predecessor-version":[{"id":1421,"href":"https:\/\/www.appservgrid.com\/paw93\/index.php\/wp-json\/wp\/v2\/posts\/1346\/revisions\/1421"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw93\/index.php\/wp-json\/wp\/v2\/media?parent=1346"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw93\/index.php\/wp-json\/wp\/v2\/categories?post=1346"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw93\/index.php\/wp-json\/wp\/v2\/tags?post=1346"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}