Successfully reported this slideshow.
Your SlideShare is downloading. ×

Virtual machines and containers

Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad

Check these out next

1 of 10 Ad
Advertisement

More Related Content

Slideshows for you (20)

Similar to Virtual machines and containers (20)

Advertisement

Recently uploaded (20)

Advertisement

Virtual machines and containers

  1. 1. Virtual Machines and Containers Patrick Pierson, KeyLUG patrickpierson.us
  2. 2. What is a Virtual Machine? A virtual machine (VM) is a software computer that, like a physical computer, runs an operating system and applications. The VM is comprised of a set of packages and configuration files and is backed by the physical resources of a host. VMs can be a server or a desktop. Virtual Machines can run Windows, Mac, or Linux operating systems and can run on Windows, Mac and Linux physical machines (aka hosts or hypervisors). Common use cases: A user’s computer is a Mac and they run VMware Fusion to virtualize a Windows desktop experience for testing their web application on Internet Explorer. A company uses Amazon Web Services (AWS) to make their demo applications quickly reproducible and available for show all over the world.
  3. 3. VM environments Virtualbox - desktop based virtualization. runs on windows, mac, linux. Allows for virtualization of windows and linux. Mac hosts can virtualize mac vms. Interface via desktop gui, lots of extensions (openstack, vagrent, etc) VMware - desktop and server based virtualization. Server based runs as ESXi os, interface with via vsphere client Amazon Web Services - is a collection of remote computing services, also called web services, that make up a cloud computing platform by Amazon.com. The most central and well-known of these services are Amazon Elastic Compute Cloud their VM infrastructure. Google Cloud Engine - is a cloud computing platform by Google that offers hosting on the same supporting infrastructure that Google uses internally for end-user products like Google Search and YouTube. Google Cloud Engine’s VM infrastructure is Google Compute Engine. Openstack - is a free and open-source cloud computing software platform. Users primarily deploy it as an infrastructure as a service (IaaS) solution. Openstack supports a wide range of VM environments but primarily supports libvirt (qemu/KVM). oVirt - is a free platform virtualization management web application community project started by Red Hat. oVirt is built on libvirt which could allow it to manage virtual machines hosted on any supported backend, including KVM, Xen and VirtualBox. (really not happy with oVirt this week) Xen - is a hypervisor using a microkernel design, providing services that allow multiple computer operating systems to execute on the same computer hardware concurrently.
  4. 4. What is a Virtual Container? Container-based virtualization, also called operating system virtualization, is an approach to virtualization in which the virtualization layer runs as an application within the operating system. In this approach, the operating system's kernel runs on the hardware node with several isolated guest virtual machines installed on top of it. The isolated guests are called containers. Currently containers only really pertain to linux. Meaning if you want to run a container it will be a linux container. Docker has setup a means to allow for linux containers to run on Windows and Mac OSes but not Windows or Mac containers. Common use cases: A developer can package a container that can be easily reproduced and sent to a customer.
  5. 5. Container environments LXC - is an operating-system-level virtualization environment for running multiple isolated Linux systems(containers) on a single Linux control host. Docker - is an open-source project that automates the deployment of applications inside software containers, by providing an additional layer of abstraction and automation of operating-system-level virtualization on Linux. Docker uses resource isolation features of the Linux kernel such as cgroups and kernel namespaces to allow independent "containers" to run within a single Linux instance, avoiding the overhead of starting virtual machines.
  6. 6. Docker vs LXC - LXC is a container technology which gives you lightweight Linux containers and Docker is a single application virtualization engine based on containers. http://www.flockport.com/lxc-vs-docker/
  7. 7. How do VMs and Containers compare? A VM image can be 10s to 100s of GBs. Lots of overlap in VM infrastructure. VMs are completely separated from each other. Very standardized. Very easy to move from VMware to oVirt to Virtualbox David Strauss, Linux Journal - http://www.linuxjournal.com/content/containers%E2%80%94not-virtual-machines%E2%80%94are-future-cloud A Container image can be be fairly small. Docker files allow for a user to setup entire containers with less then 10KB of code. Containers share the host, overlap on existing binaries and libraries. Docker allows for some entire OS containerization to almost act as a VM like environment. Not standardized...Yet.
  8. 8. Virtual Machine Demo Virtualbox 1. Ubuntu image - full os, own IP address, able to surf the internet 2. sudo -s 3. cd /home/test/ 4. virtualenv env 5. source env/bin/activate 6. pip install -r requirements.txt 7. python flask_server/app.py 8. curl -X POST http://localhost:5000/v1/ocr -d ‘{“image_url”: “https://www.realpython.com/images/blog_images/ocr/sample1.jpg”}’ -H “Content-Type: applicaion/json” 9. curl -X POST http://localhost:5000/v1/ocr -d ‘{“image_url”: “https://i.imgur.com/b5BEkhH.jpg”}’ -H Content-Type: applicaion/json”
  9. 9. Docker Demo Very easy to spin up a known state 1. sudo yum install docker 2. sudo service docker start Mysql container 1. sudo docker pull mysql 2. sudo docker run --name some-mysql -e MYSQL_ROOT_PASSWORD=mysecretpassword -d mysql 3. sudo docker run -it --link some-mysql:mysql --rm mysql sh -c 'exec mysql -h"$MYSQL_PORT_3306_TCP_ADDR" - P"$MYSQL_PORT_3306_TCP_PORT" -uroot -p"$MYSQL_ENV_MYSQL_ROOT_PASSWORD"' 4. sudo docker ps 5. show databases; Full wordpress container 1. sudo docker build -rm -t <yourname>/wordpress git://github.com/jbfink/docker-wordpress.git 2. sudo docker run --name wordpress -d -p <http_port>:80 <yourname>/wordpress #this http_port:80 should work but didnt, i removed <http_port>: and just left 80 which didnt redirect. 3. sudo docker ps 4. Go to http://localhost:49153/ # locate via netstat -an | less 5. sudo docker stop ### 6. sudo docker rm ###
  10. 10. Right now I prefer……....VMs VMs are what the industry uses for just about everything. Auto provisioning via salt, puppet, and/or chef makes spinning up a VM super simple. VMs are very customizable and very secure. Backups are a “snap”shot. Recovery is quick.

×