From 728c0634432b39aacc7650bcdac92243b5817e6b Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 11 Oct 2010 18:02:43 +0100 Subject: virt-tools website using Template Toolkit (incomplete). --- website/.gitignore | 1 + website/Makefile | 12 ++ website/README | 96 +++++++++ website/build/.keep | 1 + website/rebuild.sh | 16 ++ website/src/about/index.html | 169 +++++++++++++++ website/src/about/style.css | 15 ++ website/src/contact/index.html | 29 +++ website/src/css/easytoread.css | 7 + website/src/css/standard.css | 131 ++++++++++++ website/src/faq/index.html | 84 ++++++++ website/src/faq/style.css | 5 + website/src/index.html | 65 ++++++ .../learning/advanced-virt-df/df-centos-graph.png | Bin 0 -> 13695 bytes .../advanced-virt-df/df-openoffice-sorted.png | Bin 0 -> 43833 bytes .../learning/advanced-virt-df/df-openoffice.png | Bin 0 -> 153977 bytes website/src/learning/advanced-virt-df/index.html | 193 +++++++++++++++++ .../src/learning/check-hardware-virt/index.html | 56 +++++ website/src/learning/index.html | 73 +++++++ website/src/learning/start-conventions/index.html | 236 +++++++++++++++++++++ website/src/learning/start-conventions/style.css | 8 + .../authenticate.png | Bin 0 -> 41794 bytes .../start-install-with-virt-manager/index.html | 154 ++++++++++++++ .../start-install-with-virt-manager/installer.png | Bin 0 -> 460214 bytes .../start-install-with-virt-manager/new-button.png | Bin 0 -> 1350 bytes .../start-install-with-virt-manager/new-vm-1.png | Bin 0 -> 34127 bytes .../new-vm-2-browse.png | Bin 0 -> 17982 bytes .../start-install-with-virt-manager/new-vm-2.png | Bin 0 -> 33074 bytes .../start-install-with-virt-manager/new-vm-3.png | Bin 0 -> 23052 bytes .../start-install-with-virt-manager/new-vm-4.png | Bin 0 -> 31199 bytes .../start-install-with-virt-manager/new-vm-5.png | Bin 0 -> 30400 bytes .../start-list-with-command-line/index.html | 160 ++++++++++++++ .../start-stop-vm-with-command-line/index.html | 154 ++++++++++++++ .../ubuntu-power-dlg.png | Bin 0 -> 75258 bytes website/src/learning/start-virt-tools/index.html | 94 ++++++++ .../learning/start-vm-with-virt-manager/debian.png | Bin 0 -> 101357 bytes .../start-vm-with-virt-manager/force-off.png | Bin 0 -> 16844 bytes .../learning/start-vm-with-virt-manager/index.html | 115 ++++++++++ .../learning/start-vm-with-virt-manager/run.png | Bin 0 -> 27256 bytes .../ubuntu-power-dlg.png | Bin 0 -> 75258 bytes website/src/learning/style.css | 13 ++ website/src/style.css | 45 ++++ website/src/virtualization.png | Bin 0 -> 43312 bytes website/templates/globals | 99 +++++++++ website/templates/google_analytics | 14 ++ website/templates/h2 | 11 + website/templates/page | 56 +++++ website/templates/ttree.conf | 10 + 48 files changed, 2122 insertions(+) create mode 100644 website/.gitignore create mode 100644 website/Makefile create mode 100644 website/README create mode 100644 website/build/.keep create mode 100755 website/rebuild.sh create mode 100644 website/src/about/index.html create mode 100644 website/src/about/style.css create mode 100644 website/src/contact/index.html create mode 100644 website/src/css/easytoread.css create mode 100644 website/src/css/standard.css create mode 100644 website/src/faq/index.html create mode 100644 website/src/faq/style.css create mode 100644 website/src/index.html create mode 100644 website/src/learning/advanced-virt-df/df-centos-graph.png create mode 100644 website/src/learning/advanced-virt-df/df-openoffice-sorted.png create mode 100644 website/src/learning/advanced-virt-df/df-openoffice.png create mode 100644 website/src/learning/advanced-virt-df/index.html create mode 100644 website/src/learning/check-hardware-virt/index.html create mode 100644 website/src/learning/index.html create mode 100644 website/src/learning/start-conventions/index.html create mode 100644 website/src/learning/start-conventions/style.css create mode 100644 website/src/learning/start-install-with-virt-manager/authenticate.png create mode 100644 website/src/learning/start-install-with-virt-manager/index.html create mode 100644 website/src/learning/start-install-with-virt-manager/installer.png create mode 100644 website/src/learning/start-install-with-virt-manager/new-button.png create mode 100644 website/src/learning/start-install-with-virt-manager/new-vm-1.png create mode 100644 website/src/learning/start-install-with-virt-manager/new-vm-2-browse.png create mode 100644 website/src/learning/start-install-with-virt-manager/new-vm-2.png create mode 100644 website/src/learning/start-install-with-virt-manager/new-vm-3.png create mode 100644 website/src/learning/start-install-with-virt-manager/new-vm-4.png create mode 100644 website/src/learning/start-install-with-virt-manager/new-vm-5.png create mode 100644 website/src/learning/start-list-with-command-line/index.html create mode 100644 website/src/learning/start-stop-vm-with-command-line/index.html create mode 100644 website/src/learning/start-stop-vm-with-command-line/ubuntu-power-dlg.png create mode 100644 website/src/learning/start-virt-tools/index.html create mode 100644 website/src/learning/start-vm-with-virt-manager/debian.png create mode 100644 website/src/learning/start-vm-with-virt-manager/force-off.png create mode 100644 website/src/learning/start-vm-with-virt-manager/index.html create mode 100644 website/src/learning/start-vm-with-virt-manager/run.png create mode 100644 website/src/learning/start-vm-with-virt-manager/ubuntu-power-dlg.png create mode 100644 website/src/learning/style.css create mode 100644 website/src/style.css create mode 100644 website/src/virtualization.png create mode 100644 website/templates/globals create mode 100644 website/templates/google_analytics create mode 100644 website/templates/h2 create mode 100644 website/templates/page create mode 100644 website/templates/ttree.conf diff --git a/website/.gitignore b/website/.gitignore new file mode 100644 index 0000000..07ed706 --- /dev/null +++ b/website/.gitignore @@ -0,0 +1 @@ +build/* \ No newline at end of file diff --git a/website/Makefile b/website/Makefile new file mode 100644 index 0000000..0c54bc8 --- /dev/null +++ b/website/Makefile @@ -0,0 +1,12 @@ +# Please read the README file. + +all: + ./rebuild.sh + +clean: + find -name '*~' -delete + rm -rf build/* + +go-live: + @echo "Sorry, we've not written this yet." + @exit 1 diff --git a/website/README b/website/README new file mode 100644 index 0000000..693b984 --- /dev/null +++ b/website/README @@ -0,0 +1,96 @@ +This directory contains the source for the virt tools website. Please +read this file carefully before making modifications. + +Overview +---------------------------------------------------------------------- + +The website has four different URLs. The first is the canonical one, +the other three redirect to the first. + + http://virt-tools.org # canonical + http://virttools.org # redirect + http://virt-tools.com # redirect + http://virttools.com # redirect + +Sub-directories +---------------------------------------------------------------------- + +- src: Source for the website. + + At the moment we use the perl Template Toolkit to provide simple + includes, and apart from that it's just flat HTML. We don't yet use a + CMS although we are considering using one in future. + +- templates: Templates used to build the site. + +- build: Preview / staging directory. + +To rebuild (preview) the site, run: + + make + +and point your browser in the build/ directory: + + firefox build/index.html + +To sync the contents of build/ to the live site, run: + + make go-live + +Content and stylesheets +---------------------------------------------------------------------- + +Each page of the site corresponds to a subdirectory (this is so that +'.html' extensions don't appear in URLs). To create a new page, copy +an existing subdirectory. + +Unfortunately this means when previewing that internal links will take +you to a directory listing, but they will work OK on the live site. + +One benefit however is you can put all related files in the same +directory (eg. images, page-local stylesheet). + +Global stylesheets are in the src/css/ subdirectory. + +Some rules: + +- Do not mix styling and HTML. Use simple, small HTML and style it + via stylesheets. Don't use table layouts, HTML editorcrap etc. + Look at existing pages for clues. In other words, use your head. + +- Use relative paths so that pages can be previewed without copying + them to the live site. + +- For page-specific styles, create 'style.css' in the same directory + containing the page (eg. foo/index.html => foo/style.css), and set + the local_stylesheet variable in the wrapper. + +- Links must *not* contain 'index.html'. Links *must* end with a '/' + character. In general use: ..... + +We declare pages XHTML 1.0 Strict to avoid quirks modes, but in fact +our pages are not strict XHTML. However it's still a good idea to +fully close tags and generally make the HTML as strict as possible. + +Templates +---------------------------------------------------------------------- + +Each page starts with a 'page wrapper'. Have a look at templates/page +to see the page template. + +The variables that you can use include: + +- topdir: the relative path to the top directory ("." for the home + page, ".." for pages which are one subdirectory deep, "../.." for + pages which are two subdirectories deep, etc.) + +- title: the page title + +- h1: the page

, should probably be the same as the title, but not + too long + +- local_stylesheet: If set, this causes a local "style.css" to be + included for page-specific styles. + +- section: This controls which section menu item is highlighted. See + templates/page for the full list of sections. diff --git a/website/build/.keep b/website/build/.keep new file mode 100644 index 0000000..60fd346 --- /dev/null +++ b/website/build/.keep @@ -0,0 +1 @@ +keep directory diff --git a/website/rebuild.sh b/website/rebuild.sh new file mode 100755 index 0000000..b09df15 --- /dev/null +++ b/website/rebuild.sh @@ -0,0 +1,16 @@ +#!/bin/sh - + +ttree=/usr/bin/ttree +conf=templates/ttree.conf + +[ -x "$ttree" ] || { + echo "'ttree' is missing, you need to install the 'perl-Template-Toolkit' package" + exit 1 +} + +[ -f "$conf" ] || { + echo "configuration file missing, you are running this from the wrong directory" + exit 1 +} + +"$ttree" -f "$conf" diff --git a/website/src/about/index.html b/website/src/about/index.html new file mode 100644 index 0000000..ff1ba35 --- /dev/null +++ b/website/src/about/index.html @@ -0,0 +1,169 @@ +[% topdir = ".." -%] +[% PROCESS globals -%] +[% WRAPPER page + title = "About virt tools and the virt tools site" + h1 = "About virt tools and the virt tools site" + section = "about" + local_stylesheet = 1 +%] + +

+Virt Tools are open source virtualization management tools for Linux +system administrators. +

+ +

+This site provides tutorials, videos, documentation, online help and +roadmaps to help you understand and get started with the tools. +

+ +

+This site is an umbrella site covering many different virt projects. +Those sites also contain documentation and tutorials, and we link to +the best pages from here. +

+ +[% WRAPPER h2 h2="Contributing to the virt tools site" anchor="contribute" %] + +

+This site is open source. You can clone the sources from +this git repository +(in the website subdirectory). We welcome contributions. +Please contact us through the mailing +list. +

+ +[% END %] + +[% WRAPPER h2 h2="The upstream virt projects" anchor="projects" %] + +[%- +# Alphabetical order of project name. + upstreams = [ + { url = "http://augeas.net/", + project = "augeas", + description = "Library and tools for Linux configuration +file editing from scripts. Tools include augtool. +The Augeas APIs are exposed through libguestfs, allowing you to +make structured edits to Linux virtual machines." }, + { url = "http://people.redhat.com/~rjones/guestfs-browser/", + project = "guest filesystem browser", + description = "A graphical filesystem browser for virtual machines. +Uses libguestfs and libvirt." }, + { url = "http://libguestfs.org/hivex.3.html", + project = "hivex", + description = "Library and tools for Windows Registry +(hive file) editing. +This functionality is exposed through libguestfs, allowing you +to make changes to the Registry in your Windows guests." }, + { url = "http://libguestfs.org/", + project = "libguestfs", + description = "Library and tools for editing disk images +and files within virtual machines. Tools include: +guestfish, +virt-cat, +virt-df, +virt-inspector, +virt-resize, +virt-rescue, +virt-win-reg and +guestmount." }, + { url = "http://libvirt.org/", + project = "libvirt", + description = "Libvirt is a comprehensive API +and set of tools for managing +virtual machines across many supported hypervisors including +KVM, Xen, VirtualBox, VMWare and more. Many of the virt tools +use libvirt for virtual machine management. Libvirt tools include +virsh (the virtual shell)." }, + { url = "https://fedorahosted.org/netcf/", + project = "netcf", + description = "Library and tools for network configuration. +Tools include ncftool." }, + { url = "http://people.redhat.com/dlutter/virt-image/", + project = "virt-image", + description = "Virt-image is a portable format for interchange of virtual +machines, and a command line tool for handling that format." }, + { url = "http://virt-manager.org/", + project = "virt-install", + description = "Virt-install is a command line tool for installing +new virtual machines. It is also used as part of virt-manager." }, + { url = "http://virt-manager.org/", + project = "virt-manager", + description = "Virt-manager is a graphical tool for creating +and managing virtual machines. It offers simple, rapid management +when you don't need the scalability and complexity of larger +more advanced programs." }, + { url = "http://people.redhat.com/~rjones/virt-p2v/", + project = "virt-p2v", + description = "Virt-p2v is a live CD that you can use to +convert a physical machine into a virtual machine." }, + { url = "http://people.redhat.com/~rjones/virt-top/", + project = "virt-top", + description = "Virt-top is a monitoring program, like top +for virtual machines. It can display CPU, disk and network statistics, +and also output to a file or database." }, + { url = "", + project = "virt-v2v", + description = "Virt-v2v allows you to convert virtual machines +from Xen and VMWare over to KVM." }, + { url = "http://virt-manager.org/", + project = "virt-viewer", + description = "Virt-viewer is a console viewer for virtual +machines. It is also used as part of virt-manager." }, + { url = "http://people.redhat.com/~rjones/virt-what/", + project = "virt-what", + description = "Virt-what is a set of shell scripts that you +can use to detect if your program is running inside a virtual machine." }, + ] + +# Others: +# +# "text" virt-manager ? +# matahari ? +# virt-clone +# virt-dmesg +# virt-uname +-%] + + +[% FOREACH x IN upstreams -%] + + + + +[%- END %] +
+[% IF x.url -%] + +[%- END -%] +[% x.project %] +[%- IF x.url -%] + +[%- END %] + [% x.description %]
+ +[% END %] + +[% WRAPPER h2 h2="License" anchor="license" %] + +

+The main content of this site is copyright © [% year %] +Red Hat Inc. and licensed under +the GNU General Public License, version 2 or (at your option) any +later version. Tutorials, videos and other documentation are owned by +the respective authors. +

+ +[% END %] + +[% WRAPPER h2 h2="Technology" anchor="technology" %] + +

+The content of the site is generated from templates using the +Template Toolkit. +

+ +[% END %] + +[% END -%] diff --git a/website/src/about/style.css b/website/src/about/style.css new file mode 100644 index 0000000..432c706 --- /dev/null +++ b/website/src/about/style.css @@ -0,0 +1,15 @@ +table { + width: 40em; +} + +table th { + width: 10em; + text-align: right; + vertical-align: top; + padding-right: 1em; +} + +table td { + vertical-align: top; + padding-bottom: 1em; +} diff --git a/website/src/contact/index.html b/website/src/contact/index.html new file mode 100644 index 0000000..9e3db93 --- /dev/null +++ b/website/src/contact/index.html @@ -0,0 +1,29 @@ +[% topdir = ".." -%] +[% PROCESS globals -%] +[% WRAPPER page + title = "Mailing list, chat IRC for virt tools" + h1 = "Contact and join the virt tools team" + section = "contact" +%] + +

+If you have any questions about the virt tools which are +not answered by this site, then the best way to get help +is on our mailing list or chat (IRC) channel. +

+ +[% WRAPPER h2 h2="Mailing list" anchor="mailing-list" %] +

+ +

+[% END %] + +[% WRAPPER h2 h2="Chat (IRC)" anchor="chat" %] +

+Join #virt channel on the OFTC IRC network. +Note that at some times of the day you won't get an immediate +answer, so stay in the channel. +

+[% END %] + +[% END -%] diff --git a/website/src/css/easytoread.css b/website/src/css/easytoread.css new file mode 100644 index 0000000..97a06ea --- /dev/null +++ b/website/src/css/easytoread.css @@ -0,0 +1,7 @@ +/* High contrast, large fonts. + * $Id: easytoread.css,v 1.1 2007/01/23 16:33:28 rjones Exp $ + */ + +body { + font-size: 200%; +} \ No newline at end of file diff --git a/website/src/css/standard.css b/website/src/css/standard.css new file mode 100644 index 0000000..be60b31 --- /dev/null +++ b/website/src/css/standard.css @@ -0,0 +1,131 @@ +/* CSS for virt-tools.org */ + +body { + padding-top: 32px; /* space for menu */ + margin-left: 1em; + font-family: Helvetica; /* Fedora users get Liberation, hopefully */ +} + +body > p, body > ul, body > ol, body > dl { + margin-left: 1em; + width: 35em; +} + +li { + padding-bottom: 0.5em; +} + +/* Headings. */ + +h1 { + font-size: 125%; +} + +h2 { + font-size: 115%; +} + +h3, h4 { + font-size: 105%; +} + +h1, h2, h3, h4 { + color: #222; +} + +pre { + background-color: #fcfcfc; + /*border: 1px dotted #888;*/ + border-left: 6px solid #f0f0f0; + padding: 5px; + margin-left: 1em; + font-size: 120%; +} + +/* In subsections, links back to section at top and bottom. */ + +p#vtbacktosectiontop { + margin-top: -12px; + margin-left: 0px; + font-size: 70%; + color: #888; +} + +p#vtbacktosectiontop a { + text-decoration: none; +} + +/* Menu. */ + +ul#vtmenu { + position: absolute; + left: 1em; + top: 6px; + width: 98%; + padding: 0px; + margin: 0px; + list-style: none; +} + +ul#vtmenu li { + display: inline; + margin-left: -3px; + border: solid #fff 1px; +} + +ul#vtmenu li.vtmenuselected a, ul#vtmenu li.vtmenuselected span { + display: inline; + padding: 3px 2em 3px 2em; + background-color: #a3e8db; +} + +ul#vtmenu li.vtmenunotselected a, ul#vtmenu li.vtmenunotselected span { + display: inline; + padding: 3px 2em 3px 2em; + background-color: #93c5c2; +} + +ul#vtmenu li a:hover { + background-color: #a3e8db; +} + +ul#vtmenu a { + text-decoration: none; + color: #000; +} + +/* Footer (displayed on every page except the home page) */ + +p#vtfooter { + width: 98%; + font-size: 70%; + color: #888; +} + +/* Permalinks (see templates/h2) */ + +a.vtpermalink { + font-size: 70%; + color: #ddd; + text-decoration: none; +} + +a.vtpermalink:hover { + color: #222; +} + +/* Right-float boxes, used for margin notes, examples etc. */ + +p.vtmarginnote { + float: right; + + width: 16em; + margin-top: 0px; + margin-left: 2em; + margin-right: 2em; + padding-top: 0px; + + font-style: italic; + font-size: 85%; + color: #333; +} \ No newline at end of file diff --git a/website/src/faq/index.html b/website/src/faq/index.html new file mode 100644 index 0000000..8e994b4 --- /dev/null +++ b/website/src/faq/index.html @@ -0,0 +1,84 @@ +[% topdir = ".." -%] +[% PROCESS globals -%] +[% WRAPPER page + title = "Frequently Asked Questions (FAQ) about virt tools" + h1 = "Frequently Asked Questions (FAQ) about virt tools" + section = "faq" + local_stylesheet = 1 +%] + +[%- +# We could put this array in globals. + +questions = [ + { name = "who", + q = "Who wrote these tools? Is this just a Red Hat / Fedora project?", + a = " +

+ These tools are all open source and available on several Linux + distributions, including Fedora, Debian, Ubuntu and Gentoo, + and some of the programs have also been ported to + Mac OS X and Windows. +

+

+ All of these projects solicit input from the widest possible + community, and libvirt in particular has active developers + from all the major Linux distros. +

+

+ Red Hat sponsors some of the developers, Canonical are + active in libvirt development, and others projects and + people come from the rest of the community. +

+

+ If a tool you need is not available on your distro of choice, + please help to port it. +

" }, + { name = "why-virt-tools", + q = "Why are they called virt tools?", + a = " +

+ Simply because most of the command line tools are called + virt-something (such as virt-df and + virt-manager) and so the name virt tools + stuck. +

" }, + { name = "project-criteria", + q = "Can you feature my project? What are the criteria for being called a virt tool?", + a = " +

+ The project must be open source with an active upstream community. + It must complement the existing virt tools (in particular it should + use libvirt for lifecycle management). +

+

+ Generally we focus on small tools which are useful for + system administrators who are responsible for a few physical machines. +

+

+ The tool should be easy to install + (eg. just apt-get install / yum install, + not needing an expensive consultant to visit you on site!) +

+

+ Our focus is on Linux tools, although a Windows- or Mac-only program + wouldn't be out of the question if it met the other criteria above. +

" }, +] + +-%] + + + +[% FOREACH x IN questions -%] + [% WRAPPER h2 h2=x.q anchor=x.name %] + [% x.a %] + [% END %] +[%- END %] + + +[% END -%] diff --git a/website/src/faq/style.css b/website/src/faq/style.css new file mode 100644 index 0000000..f1cee39 --- /dev/null +++ b/website/src/faq/style.css @@ -0,0 +1,5 @@ +ul { + list-style: none; + margin: 0px; + padding: 0px; +} \ No newline at end of file diff --git a/website/src/index.html b/website/src/index.html new file mode 100644 index 0000000..2f66c7b --- /dev/null +++ b/website/src/index.html @@ -0,0 +1,65 @@ +[% topdir = "." -%] +[% PROCESS globals -%] +[% WRAPPER page + title = "virt tools: open source virtualization management tools for Linux system administrators" + h1 = "virt tools: open source virtualization management tools" + section = "home" + local_stylesheet = 1 %] + +

+Virt Tools are open source virtualization management tools for Linux +system administrators. This site provides tutorials, videos, +documentation, online help and roadmaps to help you understand and get +started with the tools. Our most popular virt tools are virt-manager, +virsh, virt-install, virt-v2v, guestfish, virt-p2v, virt-df and +virt-viewer. Find out more ... +

+ +Virtualization + +
+

Latest articles

+ +[%# This just links to my blog at the moment, but eventually we + will use a planet to aggregate all relevant posts from all + contributors together -- RWMJ. %] + + + + + +

+More news ... +

+ +
+ +
+

Video tutorials

+ + + + +
+ +
+

Get started

+ + + +
+ +[% END -%] diff --git a/website/src/learning/advanced-virt-df/df-centos-graph.png b/website/src/learning/advanced-virt-df/df-centos-graph.png new file mode 100644 index 0000000..9d32a53 Binary files /dev/null and b/website/src/learning/advanced-virt-df/df-centos-graph.png differ diff --git a/website/src/learning/advanced-virt-df/df-openoffice-sorted.png b/website/src/learning/advanced-virt-df/df-openoffice-sorted.png new file mode 100644 index 0000000..50d2d6e Binary files /dev/null and b/website/src/learning/advanced-virt-df/df-openoffice-sorted.png differ diff --git a/website/src/learning/advanced-virt-df/df-openoffice.png b/website/src/learning/advanced-virt-df/df-openoffice.png new file mode 100644 index 0000000..4d5c587 Binary files /dev/null and b/website/src/learning/advanced-virt-df/df-openoffice.png differ diff --git a/website/src/learning/advanced-virt-df/index.html b/website/src/learning/advanced-virt-df/index.html new file mode 100644 index 0000000..c8840f0 --- /dev/null +++ b/website/src/learning/advanced-virt-df/index.html @@ -0,0 +1,193 @@ +[% topdir = "../.." -%] +[% PROCESS globals -%] +[% WRAPPER page + title = "Advanced use of virt-df" + h1 = "Advanced use of virt-df" + section = "learning" +%] + +

+This tutorial discusses advanced use of +virt-df. +Some of the topics covered are: +

+ + + +[% WRAPPER h2 h2="CSV output" anchor="csv" %] + +

+If you are going to do anything apart from looking at the output of +virt-df, you should use the --csv flag so that virt-df +produces machine-readable +comma-separated +values (CSV) output. The output looks like this: +

+ +
+# virt-df --csv
+Virtual Machine,Filesystem,1K-blocks,Used,Available,Use%
+"CentOS5x64","/dev/sda1",101086,19290,76577,19.1%
+"CentOS5x64","/dev/VolGroup00/LogVol00",8030648,3116144,4499992,38.8%
+[etc]
+
+ +[% END %] + +[% WRAPPER h2 h2="Using cron" anchor="cron" %] + +

+You can write a cron job to collect virt-df output periodically +(I collect it once a day). +

+ +
+# cat > /etc/cron.daily/local-virt-df
+#!/bin/bash -
+date=$(date +%F)
+virt-df --csv > /var/local/virt-df.$date
+# chmod 0755 /etc/cron.daily/local-virt-df
+
+ +

+The cron job will create one file every day in /var/local. +

+ +[% END %] + +[% WRAPPER h2 + h2="Importing the data into spreadsheets and databases" anchor="import" %] + +

+CSV files can be loaded directly into spreadsheets and databases: +

+ +

+ +

+ +
+CREATE TABLE df_data (
+  "Virtual Machine" TEXT NOT NULL,
+  "Filesystem" TEXT NOT NULL,
+  "1K-blocks" BIGINT NOT NULL,
+  "Used" BIGINT NOT NULL,
+  "Available" BIGINT NOT NULL,
+  "Use%" TEXT
+);
+COPY df_data FROM 'df.csv' WITH DELIMITER ',' CSV HEADER;
+
+ +[% END %] + +[% WRAPPER h2 h2="Sorting and querying the data" anchor="query" %] + +

+Once your data has been imported, you can start to process it, +for example finding out which virtual machines are running +out of space: +

+ +

+ +

+ +

+The following PostgreSQL query on the previously imported data +shows all filesystems with over 60% usage: +

+ +
+SELECT "Virtual Machine", "Filesystem"
+  FROM df_data
+ WHERE (100. * "Used" / "1K-blocks") > 60;
+
+ Virtual Machine |              Filesystem              
+-----------------+--------------------------------------
+ Debian5x64      | /dev/debian5x64.home.annexia.org/usr
+ OpenSUSE11x64   | /dev/sda2
+ VBox            | /dev/vg_f13x64/lv_root
+(3 rows)
+
+ +[% END %] + +[% WRAPPER h2 h2="Graphs and trends" anchor="graphs" %] + +

+You can use daily historical data to graph disk usage. +In theory at least you could use trends in this data +to predict future requirements, although in my experience +usage tends to be lumpy — installing OpenOffice +in a VM results in a big increase in usage which is not +indicative of any trend. +

+ +

+In any case, here is a graph of usage data for one VM filesystem +over approximately one month, generated using OpenOffice Calc +(Insert → Chart) with a linear trend line +(select chart and do Insert → Trend Lines): +

+ +

+ +

+ +[% END %] + +[% WRAPPER h2 h2="Alerts" anchor="alerts" %] + + + + + + + + + +[% END %] + +[% WRAPPER h2 h2="Safety" anchor="safety" %] + +

+virt-df is generally safe to use with untrusted or malicious guests, +but there are some things to be aware of. +

+ +

+An untrusted guest can present any disk data that it wants +to the host. By simple manipulations of the filesystem it can show +the disk as full when it is empty, or empty when it is full. This +is not important in itself, it only becomes an issue if a guest +could manipulate the statistics of another unrelated VM. +

+ +

+Older versions of virt-df ran a separate libguestfs appliance for each +guest. This is safe because one guest cannot possibly interfere with +the statistics from another, but also slow. Since virt-df 1.5.0, +several unrelated guests may share a single libguestfs appliance, +which is much faster but there is a (slim) possibility that one guest +might corrupt the appliance leading to misreported statistics for +another guest. +

+ +

+You can get the old, safest possible behaviour by adding +the --one-per-guest flag to the virt-df command line. +

+ +[% END %] + +[% END -%] diff --git a/website/src/learning/check-hardware-virt/index.html b/website/src/learning/check-hardware-virt/index.html new file mode 100644 index 0000000..11160cd --- /dev/null +++ b/website/src/learning/check-hardware-virt/index.html @@ -0,0 +1,56 @@ +[% topdir = "../.." -%] +[% PROCESS globals -%] +[% WRAPPER page + title = "How to check if your hardware supports virtualization" + h1 = "How to check if your hardware supports virtualization" + section = "learning" +%] + +[% WRAPPER h2 h2="Hardware virtualization technologies" anchor="hvm" %] + +

+The first machines to support virtualization were IBM mainframes +in the 1970s. +XXXXXXXXXXX BACKGROUND XXXXXXXXXXXX +

+ +

+Until a few years ago the central processors in server PCs were not +virtualizable except by using slow +emulation or tricks. However both AMD and Intel have recently +produced processors which include extra modes and instructions +that allow full, hardware-accelerated virtualization. +

+ +

+AMD and Intel's virtualization techniques are different and +incompatible, but all hypervisors hide the differences from you. +

+ +

+There are also several generations of virtualization technologies +available. Initial implementations from both AMD and Intel were quite +slow, and great improvements have been made over time. This article +does not talk about all these variations since the differences are +mostly hidden from the end user. The upshot is that more modern +processors are not only faster, but the virtualization will be more +efficient too. +

+ +[% END %] + +XXX XXX XXX +[%# +- look up model number on Intel's site +- dmesg +- disabled in BIOS +- kvm_* module loaded +- Ubuntu virt tool? +%] + + + + + + +[% END -%] diff --git a/website/src/learning/index.html b/website/src/learning/index.html new file mode 100644 index 0000000..af267cb --- /dev/null +++ b/website/src/learning/index.html @@ -0,0 +1,73 @@ +[% topdir = ".." -%] +[% PROCESS globals -%] +[% WRAPPER page + title = "virt tools: Tutorials and videos" + h1 = "virt tools: Tutorials and videos" + section = "learning" + local_stylesheet = 1 +%] + +[% WRAPPER h2 h2="For absolute beginners, start here" anchor="beginners" %] + +[% BLOCK element %] +
  • + [% x.link %] + [% x.rest %] + + [% IF x.difficulty > 1 %]Difficulty: [% x.difficulty %] out of 5.[% END %] + [% IF x.cmdline %]Requires use of the command line.[% END %] + [% IF x.author %]Author: [% x.author %].[% END %] + [% IF x.date %]Last updated: [% x.date %].[% END %] + +
  • +[% END %] + + + +[% END %] + +[% WRAPPER h2 h2="Tutorials rated easy" anchor="easy" %] + + + +[% END %] + +[% WRAPPER h2 h2="Tutorials rated a little harder" anchor="others" %] + + + +[% END %] + +[% WRAPPER h2 h2="More help" anchor="more-help" %] + +

    +Not found what you're looking for? +Contact us via our mailing list +or chat (IRC). +

    + +[% END %] + +[% WRAPPER h2 h2="Contribute" anchor="contribute" %] + +

    +Do you want to write a tutorial? Do you blog about virt tools? +Your writings could appear here. +Send us a note on the mailing list. +

    + +[% END %] + +[% END -%] diff --git a/website/src/learning/start-conventions/index.html b/website/src/learning/start-conventions/index.html new file mode 100644 index 0000000..bb0781c --- /dev/null +++ b/website/src/learning/start-conventions/index.html @@ -0,0 +1,236 @@ +[% topdir = "../.." -%] +[% PROCESS globals -%] +[% WRAPPER page + title = "Names and terms used in the virt tools documentation" + h1 = "Names and terms used in the virt tools documentation" + section = "learning" + local_stylesheet = 1 +%] + +[% WRAPPER h2 h2="Hosts, guests, virtual machines, hypervisors" anchor="names" %] + +

    +The virt tools and +project documentation +uses the terms +guest, +virtual machine, +VM and +domain interchangably to refer to a virtual machine. +The term domain comes from Xen. +

    + +

    +When we say host we mean the ordinary physical machine +and the operating system which contains the guests. +

    + +

    +The term hypervisor has several different meanings: +

    + + + +

    +Xen (only) uses the special terms Dom0 (a.k.a. +Domain-0) and DomU as synonyms +for host and guest respectively. +

    + +[% END %] + +[% WRAPPER h2 h2="Full virtualization and paravirtualization" anchor="fvpv" %] + +

    +Examples of full virtualization technologies: +Bochs, QEMU, KVM, VMWare, Xen-FV, MAME. +

    + +

    +Full virtualization (or fullvirt, +FV) is what you use to run an unmodified operating +system as a virtual machine. The operating system thinks it is +running on a PC, and (from the point of view of the guest) it sees +usual hardware like a keyboard, disk drive, monitor and so on. These +of course are not real, but are emulated by the hypervisor technology +underneath. +

    + +

    +Full virtualization is usually a bit slower, because of all the +emulation, but it has the big advantage that you can run unmodified +operating systems like Windows. +

    + +

    +Paravirtualization +(or paravirt, PV) is where you +modify the guest operating system so that it knows it is running in a +virtual machine and it cooperates with the host. This is done to gain +extra performance by avoiding unnecessary emulation. +

    + +

    +There are essentially two methods currently in use for +paravirtualization. The Xen paravirt approach makes +deep changes to the Linux kernel so that cooperation is achieved at +many levels. The advantage of Xen paravirt is +that hardware support is not required, but the +disadvantage is it is only possible for some Linux guests. +

    + +

    +Examples of FV with PV drivers technologies: +KVM Virtio, VMWare Tools, VirtualBox Additions, Xen-PV drivers. +

    + +

    +The more common approach these days is device driver +paravirtualization where only the device drivers of the +operating system are replaced. This is sometimes called +fullvirt with PV drivers. This gains almost all the +performance benefits of paravirtualization, it works with Windows +guests, and it can be implemented incrementally by starting with a +fullvirt guest and adding PV drivers as required. The downside is +that you need hardware support. The most commonly paravirtualized +devices are: the hard disk (often called the block device), the +network device, the console, and the clock. +

    + +

    +Virtio is an emerging standard for +paravirtualized drivers, and is particularly used for +QEMU and KVM guests. Virtio PV drivers are available +for many different operating systems. +

    + +[% END %] + +[% WRAPPER h2 h2="Hardware support for virtualization" anchor="hardware" %] + +

    +Nowadays most computer processors contain extra support to accelerate +virtualization (see this tutorial to +check if yours has support and to find out more about the different +types). +

    + +

    +Support in hardware is often called hardware +virtualization (or hardware virt), +abbreviated to HVM. +

    + +[% END %] + +[% WRAPPER h2 h2="Lifecycle" anchor="lifecycle" %] + +

    +Virtual machines can be started and stopped, and you may see this +being referred to as the lifecycle +or lifecycle management. This is entirely equivalent +to switching a real machine on and off. +

    + +

    +As well as just being started and stopped (and unlike real machines), +virtual machines can be paused, +snapshotted and cloned. +

    + +

    +Taking a snapshot usually means to save the state of the +virtual machine at a moment in time, either so it can be +backed up consistently, or so that you can try some experimental +operation and roll back to the snapshot if that fails. +

    + +

    +Cloning is somewhat similar to snapshotting, but the two +clones are allowed to run independently of each other +(and cannot be combined again), so that whereas before you +had one virtual machine, now you have two. +

    + +

    +Another aspect of lifecycle management is saving +and restoring virtual machines. +

    + +[% END %] + +[% WRAPPER h2 h2="Disks and storage" anchor="storage" %] + +

    +The hard drive of a virtual machine is usually emulated ie. it's not +a physical, separate hard drive, but a file or logical volume on the +host. This host file (or however it is stored) is called +the disk image. +

    + +

    +Disk images are allocated in volumes +out of storage pools. +

    + +[% END %] + +[% WRAPPER h2 h2="Migration" anchor="migration" %] + +

    +Migration means moving a virtual machine from +one host to another. Usually this means live migration +where the running VM is moved without interruption. +

    + +

    +Don't confuse migration and conversion (see next section). +

    + +[% END %] + +[% WRAPPER h2 h2="P2V, V2V and V2P" anchor="p2v" %] + +

    +The terms P2V, +V2V, and V2P refer to different +sorts of conversions: +

    + + + + + + + + + + + + + + +
    P2V Physical to virtual: Converting a physical machine to a +virtual machine. This is often done so you can continue to +use the applications on the physical machine, but with newer +hardware underneath.
    V2V Virtual to virtual: Converting a virtual machine +from one hypervisor technology to another, for example +converting a VMWare virtual machine to run on KVM to +save money.
    V2P Virtual to physical: This is the reverse of P2V, taking +a virtual machine and restoring it onto a physical machine.
    + +[% END %] + +[% END -%] diff --git a/website/src/learning/start-conventions/style.css b/website/src/learning/start-conventions/style.css new file mode 100644 index 0000000..2cd4ee6 --- /dev/null +++ b/website/src/learning/start-conventions/style.css @@ -0,0 +1,8 @@ +table { + width: 40em; +} + +table th { + vertical-align: top; + text-align: right; +} diff --git a/website/src/learning/start-install-with-virt-manager/authenticate.png b/website/src/learning/start-install-with-virt-manager/authenticate.png new file mode 100644 index 0000000..c84a389 Binary files /dev/null and b/website/src/learning/start-install-with-virt-manager/authenticate.png differ diff --git a/website/src/learning/start-install-with-virt-manager/index.html b/website/src/learning/start-install-with-virt-manager/index.html new file mode 100644 index 0000000..29d610c --- /dev/null +++ b/website/src/learning/start-install-with-virt-manager/index.html @@ -0,0 +1,154 @@ +[% topdir = "../.." -%] +[% PROCESS globals -%] +[% WRAPPER page + title = "Installing a virtual machine with virt-manager" + h1 = "Installing a virtual machine with virt-manager" + section = "learning" +%] + +

    +Installing a virtual machine in virt-manager is a three step +process. First download the operating +system ISO that you want to install. +Secondly start virt-manager +and create a new virtual machine for your +guest. Lastly run the guest installer +from the ISO. +

    + +

    +You may also be interested in our +tutorial which explains how to do all of this from the command line. +

    + +[% WRAPPER h2 h2="Download the ISO" anchor="download" %] + +

    +Download an ISO of the operating system you want to install. +Here are some common starting points: +

    + + + +

    +Remember the operating system you install as a guest does +not need to be the same as your host! +

    + +[% END %] + +[% WRAPPER h2 h2="Start virt-manager" anchor="virt-manager" %] + +

    +Start virt-manager +(Applications → System Tools → Virtual Machine Manager) +

    + +

    +You may be asked to select the hypervisor and/or type your +root password: +

    + +

    + +

    + +[% END %] + +[% WRAPPER h2 h2="Start new VM wizard" anchor="new-vm" %] + +

    +Click the button in the top left corner to begin installing +your virtual machine: +

    + +

    + +

    + +

    + +

    + +

    +Since you have downloaded an ISO, you need to select +Local install media. Also choose a name for the +new guest. +

    + +

    +At the next step you need to tell virt-manager where +you downloaded the ISO to. When you click Browse +you will see the default libvirt storage volume (which +will probably be empty the first time): +

    + +

    + +

    + +

    +Click Browse Local to browse to the ISO on your +local disk. +

    + +

    + +

    + +

    +The third step allows you to choose the amount of RAM +and number of virtual CPUs allocated to the guest. For +KVM guests, RAM can be overcommitted carefully (you can allocate +more RAM to all your guests than you really have available). +For Xen guests this is not possible. A modern Linux guest +requires at least 512 MB of RAM, and more is better. +

    + +

    + +

    + +

    +If all goes well you should be able to skip through +the next steps and start your install: +

    + +

    + +

    + +

    + +

    + +[% END %] + +[% WRAPPER h2 h2="Run the installer" anchor="installer" %] + +

    +From now on you should install the guest from the ISO +as if you were installing it on real hardware: +

    + +

    + +

    + +[% END %] + +[% END -%] diff --git a/website/src/learning/start-install-with-virt-manager/installer.png b/website/src/learning/start-install-with-virt-manager/installer.png new file mode 100644 index 0000000..14cd3a4 Binary files /dev/null and b/website/src/learning/start-install-with-virt-manager/installer.png differ diff --git a/website/src/learning/start-install-with-virt-manager/new-button.png b/website/src/learning/start-install-with-virt-manager/new-button.png new file mode 100644 index 0000000..993c906 Binary files /dev/null and b/website/src/learning/start-install-with-virt-manager/new-button.png differ diff --git a/website/src/learning/start-install-with-virt-manager/new-vm-1.png b/website/src/learning/start-install-with-virt-manager/new-vm-1.png new file mode 100644 index 0000000..b9e2449 Binary files /dev/null and b/website/src/learning/start-install-with-virt-manager/new-vm-1.png differ diff --git a/website/src/learning/start-install-with-virt-manager/new-vm-2-browse.png b/website/src/learning/start-install-with-virt-manager/new-vm-2-browse.png new file mode 100644 index 0000000..ac57c9b Binary files /dev/null and b/website/src/learning/start-install-with-virt-manager/new-vm-2-browse.png differ diff --git a/website/src/learning/start-install-with-virt-manager/new-vm-2.png b/website/src/learning/start-install-with-virt-manager/new-vm-2.png new file mode 100644 index 0000000..a27c17d Binary files /dev/null and b/website/src/learning/start-install-with-virt-manager/new-vm-2.png differ diff --git a/website/src/learning/start-install-with-virt-manager/new-vm-3.png b/website/src/learning/start-install-with-virt-manager/new-vm-3.png new file mode 100644 index 0000000..382bc3e Binary files /dev/null and b/website/src/learning/start-install-with-virt-manager/new-vm-3.png differ diff --git a/website/src/learning/start-install-with-virt-manager/new-vm-4.png b/website/src/learning/start-install-with-virt-manager/new-vm-4.png new file mode 100644 index 0000000..b95cf52 Binary files /dev/null and b/website/src/learning/start-install-with-virt-manager/new-vm-4.png differ diff --git a/website/src/learning/start-install-with-virt-manager/new-vm-5.png b/website/src/learning/start-install-with-virt-manager/new-vm-5.png new file mode 100644 index 0000000..5635412 Binary files /dev/null and b/website/src/learning/start-install-with-virt-manager/new-vm-5.png differ diff --git a/website/src/learning/start-list-with-command-line/index.html b/website/src/learning/start-list-with-command-line/index.html new file mode 100644 index 0000000..3fe5deb --- /dev/null +++ b/website/src/learning/start-list-with-command-line/index.html @@ -0,0 +1,160 @@ +[% topdir = "../.." -%] +[% PROCESS globals -%] +[% WRAPPER page + title = "List virtual machines using the command line" + h1 = "List virtual machines using the command line" + section = "learning" +%] + +

    +Open a Terminal window. +

    + +

    +On Fedora and Debian you will need to become root. Type +the following command and, when prompted, your root password: +

    + +
    +su
    +
    + +

    +Then you can list all the virtual machines: +

    + +
    +virsh list --all
    +
    + +

    +On Ubuntu, you should use sudo to run the command +as root instead: +

    + +
    +sudo virsh list --all
    +
    + +[% WRAPPER h2 h2="virsh list output explained" anchor="virsh-list-output" %] + +

    +When you run the command you should see a listing like this: +

    + +
    + Id Name                 State
    +----------------------------------
    +  3 FedoraRawhide        running
    +  - Debian               shut off
    +
    + +

    +The three columns are: +

    + + + +

    +Other virt tools commands can use either the Id or the +Name to refer to the virtual machine. For example +these two commands are equivalent ways to show the console: +

    + +
    +virt-viewer 3
    +virt-viewer FedoraRawhide
    +
    + +[% END %] + +[% WRAPPER h2 h2="virsh list troubleshooting" anchor="virsh-list-troubleshooting" %] + +

    +If virsh list displays an error, then try +searching for the error or contacting us. +For QEMU, KVM, and remote connections, ensure that the +libvirtd service is running. +

    + +

    +Many errors are obvious from the error message, for example: +

    + +
    +error: no connection driver available for xen:///
    +error: failed to connect to the hypervisor
    +
    + +

    +would mean that the Xen hypervisor is not running on the +local machine. +

    + +

    +If virsh list --all runs but displays nothing, it +could mean: +

    + + + +[% END %] + +[% WRAPPER h2 h2="virsh flags" anchor="virsh-flags" %] + +

    +The --all flag lists all virtual machines, which +includes ones which are currently running and ones which are +switched off. If you omit this flag then only running virtual +machines are shown. +

    + +

    +Another useful flag is -c which can be used to +select the hypervisor. This can be used if you are running +two hypervisors on one machine (eg. Xen and QEMU guests), +or if you are not root and want to connect to the system +hypervisor, or to connect to a remote server running libvirtd. +

    + +

    +Use the -r flag to connect read-only to the hypervisor. +This is useful to perform operations while not requiring the +root password. +

    + +

    +For example, if you are not root and want to list QEMU and KVM guests +without needing the root password you could do: +

    + +
    +virsh -r -c qemu:///system list --all
    +
    + +

    +This libvirt documentation describes +remote connections in detail. +

    + +[% END %] + + + +[% END -%] diff --git a/website/src/learning/start-stop-vm-with-command-line/index.html b/website/src/learning/start-stop-vm-with-command-line/index.html new file mode 100644 index 0000000..888efcd --- /dev/null +++ b/website/src/learning/start-stop-vm-with-command-line/index.html @@ -0,0 +1,154 @@ +[% topdir = "../.." -%] +[% PROCESS globals -%] +[% WRAPPER page + title = "Starting and stopping VMs from the command line" + h1 = "Starting and stopping VMs from the command line" + section = "learning" +%] + +

    +Lifecycle management (which is a fancy way of +saying starting and stopping virtual machines) can be done +either from virt-manager +or directly from the command line or shell scripts +using virsh. +

    + +

    +These commands generally require that you are root. On +Fedora and Debian, do: +

    + +
    +su
    +
    + +

    +and type the root password. +

    + +

    +On Ubuntu you can prefix each command with sudo, +or get a root shell first by doing: +

    + +
    +sudo bash
    +
    + +

    +List out the +virtual machines that you have available. You can +then substitute the name of one of your virtual machines +for generic Guest below. +

    + +[% WRAPPER h2 h2="Starting a virtual machine with virsh" anchor="start" %] + +

    +To start a virtual machine running, do: +

    + +
    +virsh start Guest
    +
    + +

    +where Guest is the name of the virtual machine. Check +that it is running by +using virsh list +or connecting to the console with: +

    + +
    +virt-viewer Guest
    +
    + +[% END %] + +[% WRAPPER h2 h2="Stopping the virtual machine with virsh" anchor="stop" %] + +

    +Stopping the virtual machine is a little more complex and requires +some understanding of how real PC hardware works. +

    + +

    Pull the plug

    + +

    +On a real PC you can just pull out the power cord (and battery +if it's a laptop). This abruptly shuts the machine down, but +it's not usually a good thing to do since the operating system +gets no time to gracefully shut down applications and synchronize +the disk. +

    + +

    +You can do this from virsh too using the +virsh destroy command, but be careful as the guest is +switched off with no warning and no chance to sync the disks: +

    + +
    +virsh destroy Guest
    +
    + +

    ACPI

    + +

    +The more common option is to reboot or shutdown the guest: +

    + +
    +virsh reboot Guest
    +
    + +
    +virsh shutdown Guest
    +
    + +

    +You cannot reboot or shut down a machine (real or virtual) without +cooperation from the operating system. On a real PC the power switch +just sends a signal to the operating system, and the operating system +has to be listening out for the signal and has to react by doing the +right thing. This signal mechanism is known as +ACPI. +The same mechanism is used to wire the virtual power +switch to the virtual machine. +

    + +

    +Using the virsh reboot or virsh shutdown +commands is like pressing the virtual power button, and it may +open a dialog inside the VM like this one (taken +from an Ubuntu guest): +

    + +

    + +

    + +

    +The precise action taken depends on: +

    + + + +

    +If a guest won't shut down or reboot, it is usually caused +by a problem with ACPI and/or guest configuration. Eventually +you may need to virsh destroy guests that don't +respond to ordinary events. +

    + +[% END %] + +[% END -%] diff --git a/website/src/learning/start-stop-vm-with-command-line/ubuntu-power-dlg.png b/website/src/learning/start-stop-vm-with-command-line/ubuntu-power-dlg.png new file mode 100644 index 0000000..1fcd58e Binary files /dev/null and b/website/src/learning/start-stop-vm-with-command-line/ubuntu-power-dlg.png differ diff --git a/website/src/learning/start-virt-tools/index.html b/website/src/learning/start-virt-tools/index.html new file mode 100644 index 0000000..b6b2e91 --- /dev/null +++ b/website/src/learning/start-virt-tools/index.html @@ -0,0 +1,94 @@ +[% topdir = "../.." -%] +[% PROCESS globals -%] +[% WRAPPER page + title = "Installing virt tools" + h1 = "Download and install virt tools" + section = "learning" +%] + +

    +Select your operating system or Linux distro from the list below: +

    + + + +[% WRAPPER h2 h2="Fedora, Red Hat Enterprise Linux" anchor="fedora" %] + +

    Graphical method

    + +

    +Go to System → Administration → Add/Remove Software. +

    + +

    +From the list on the left, select Virtualization. +

    + +

    +Select the required virt tools and click Apply. +

    + +

    From the command line

    + +

    +Open a terminal window (Applications → System Tools → Terminal) +and type the following: +

    + +
    +su
    +
    + +

    +(now type your root password) +

    + +
    +yum install qemu libvirt-client virt-manager \
    +  virt-viewer guestfish libguestfs-tools virt-top
    +
    + +[% END %] + +[% WRAPPER h2 h2="Debian" anchor="debian" %] + +

    +Open a terminal window (Applications → Accessories → Terminal) +and type: +

    + +
    +su
    +apt-get install kvm libvirt-bin virt-manager virt-viewer virt-top
    +
    + +

    +For information on installing guestfish and libguestfs-tools in +Debian, see this page. +

    + +[% END %] + +[% WRAPPER h2 h2="Ubuntu" anchor="ubuntu" %] + +

    +Open a terminal window (Applications → Accessories → Terminal) +and type: +

    + +
    +sudo apt-get install ubuntu-virt virt-top virt-what
    +
    + +

    +For information on installing guestfish and libguestfs-tools in +Ubuntu, see this page. +

    + +[% END %] + +[% END -%] diff --git a/website/src/learning/start-vm-with-virt-manager/debian.png b/website/src/learning/start-vm-with-virt-manager/debian.png new file mode 100644 index 0000000..e4ff0a3 Binary files /dev/null and b/website/src/learning/start-vm-with-virt-manager/debian.png differ diff --git a/website/src/learning/start-vm-with-virt-manager/force-off.png b/website/src/learning/start-vm-with-virt-manager/force-off.png new file mode 100644 index 0000000..a9def3d Binary files /dev/null and b/website/src/learning/start-vm-with-virt-manager/force-off.png differ diff --git a/website/src/learning/start-vm-with-virt-manager/index.html b/website/src/learning/start-vm-with-virt-manager/index.html new file mode 100644 index 0000000..2fcfc51 --- /dev/null +++ b/website/src/learning/start-vm-with-virt-manager/index.html @@ -0,0 +1,115 @@ +[% topdir = "../.." -%] +[% PROCESS globals -%] +[% WRAPPER page + title = "Starting and stopping virtual machines with virt-manager" + h1 = "Starting and stopping virtual machines with virt-manager" + section = "learning" +%] + +

    +In principle, lifecycle management (which is a fancy way of +saying starting and stopping virtual machines) is quite easy. +

    + +[% WRAPPER h2 h2="Starting the virtual machine" anchor="start" %] + +

    +To start a virtual machine running, select it from the list and either +press the play button or right click and select Run: +

    + +

    + +

    + +

    +When the virtual machine is running, two things will change. You +will get a small graph showing the CPU usage in the main virt-manager +window. And if you double click on the virtual machine, virt-manager +will open another window showing you the console: +

    + +

    + +

    + +[% END %] + +[% WRAPPER h2 h2="Stopping the virtual machine" anchor="stop" %] + +

    +Stopping the virtual machine is a little more complex and requires +some understanding of how real PC hardware works. +

    + +

    Force off

    + +

    +On a real PC you can just pull out the power cord (and battery +if it's a laptop). This abruptly shuts the machine down, but +it's not usually a good thing to do since the operating system +gets no time to gracefully shut down applications and synchronize +the disk. +

    + +

    +Nevertheless virt-manager lets you do this: From the switch +menu select Force Off: +

    + +

    + +

    + +

    ACPI

    + +

    +The other two options on this menu are Reboot and +Shut Down. However you cannot reboot or shut down +a machine (real or virtual) without cooperation from the +operating system. On a real PC the power switch just sends +a signal to the operating system, and the operating system +has to be listening out for the signal and has to react +by doing the right thing. This signal mechanism +is known as +ACPI. +The same mechanism is used to wire the virtual power +switch to the virtual machine. +

    + +

    +This is why pressing the virtual power button may +open a dialog inside the VM like this one (taken +from an Ubuntu guest): +

    + +

    + +

    + +

    +The precise action taken depends on: +

    + + + +

    +If a guest won't shut down or reboot, it is usually caused +by a problem with ACPI and/or guest configuration. Eventually +you may need to use the Force Off option on recalcitrant +guests. +

    + +[% END %] + +[% END -%] diff --git a/website/src/learning/start-vm-with-virt-manager/run.png b/website/src/learning/start-vm-with-virt-manager/run.png new file mode 100644 index 0000000..429b47d Binary files /dev/null and b/website/src/learning/start-vm-with-virt-manager/run.png differ diff --git a/website/src/learning/start-vm-with-virt-manager/ubuntu-power-dlg.png b/website/src/learning/start-vm-with-virt-manager/ubuntu-power-dlg.png new file mode 100644 index 0000000..1fcd58e Binary files /dev/null and b/website/src/learning/start-vm-with-virt-manager/ubuntu-power-dlg.png differ diff --git a/website/src/learning/style.css b/website/src/learning/style.css new file mode 100644 index 0000000..b7c6867 --- /dev/null +++ b/website/src/learning/style.css @@ -0,0 +1,13 @@ +/* Local stylesheet. */ + +ul { + list-style: none; + margin: 0px; + padding: 0px; +} + +span.notes { + display: block; + font-size: 70%; + color: #888; +} \ No newline at end of file diff --git a/website/src/style.css b/website/src/style.css new file mode 100644 index 0000000..67c31f7 --- /dev/null +++ b/website/src/style.css @@ -0,0 +1,45 @@ +/* Local stylesheet for home page. */ + +img#vtboximage { + position: absolute; + left: 40em; + top: 5em; +} + +div#vtleft { + width: 16em; + position: absolute; + left: 1em; + top: 14em; +} + +div#vtleft h2, div#vtmid h2, div#vtright h2 { + /*background-color: #93c5c2;*/ +} + +div#vtmid { + width: 16em; + position: absolute; + left: 18em; + top: 14em; +} + +div#vtright { + width: 16em; + position: absolute; + left: 35em; + top: 14em; +} + +ul { + list-style: none; + margin: 0px; + padding: 0px; +} + +/* Don't display footer on the front page, because the columns in + the center of the page don't make this easy. */ + +p#vtfooter { + display: none; +} \ No newline at end of file diff --git a/website/src/virtualization.png b/website/src/virtualization.png new file mode 100644 index 0000000..e4e54d1 Binary files /dev/null and b/website/src/virtualization.png differ diff --git a/website/templates/globals b/website/templates/globals new file mode 100644 index 0000000..79d7d2f --- /dev/null +++ b/website/templates/globals @@ -0,0 +1,99 @@ +[% USE date -%] +[% +# This global template is included in every HTML file. It is +# included before the DOCTYPE and it *must not* generate any +# output. Be careful to chomp! However it is a very useful +# place to put global variables. Note that the only variable +# that is passed in here is topdir. + +year = date.format(date.now, '%Y') +printable_date = date.format + +# These are the sections / tabs of the site as they appear in +# the navigation at the top of all pages. + +sections = [ "home", "news", "learning", "faq", "about", "contact" ] + +section_titles.home = "Home" +section_titles.news = "News" +section_titles.learning = "Tutorials and videos" +section_titles.faq = "FAQ" +section_titles.about = "About this site" +section_titles.contact = "Contact us" + +section_paths.home = "/" +section_paths.news = "/news/" +section_paths.learning = "/learning/" +section_paths.faq = "/faq/" +section_paths.about = "/about/" +section_paths.contact = "/contact/" + +# The full list of local resources under src/learning/ +# +# Put new documents at the top. +# +# If the resource is really beginner level, then set difficulty = 0. +# Use this sparingly because these appear in 'Get started' on the +# front page of the site, and also at the top of the list. +# +# Other variables: +# difficulty: Difficulty level 0 (absolute beginner) 1 (easy) .. 5 (hardest). +# cmdline: (optional) Set to 1 if this involves using the command line. +# author: (optional) String containing author's name. +# date: (optional) Date last updated (use: date +%F) +# +# The text will be displayed to the user as: +# [link] [rest] + +learning_documents = [ + { difficulty = 0, cmdline = 1, + name = "start-virt-tools", + link = "Where to get virt tools.", + rest = "Learn how to download or obtain virt tools on Fedora, + Debian, Ubuntu, RHEL and more." }, + { difficulty = 0, + name = "start-conventions", + link = "Names and terms used in the rest of the documentation.", + rest = "If you confused by words like paravirt, migration, + domain, then start here." }, + { difficulty = 0, + name = "start-install-with-virt-manager", + link = "Install a virtual machine", + rest = "with virt-manager. A step by step guide to creating + your first virtual machine using simple graphical tools." }, + { difficulty = 0, + name = "start-vm-with-virt-manager", + link = "Start and stop virtual machines", + rest = "using graphical virt-manager." }, + { difficulty = 0, cmdline = 1, + name = "start-list-with-command-line", + link = "List virtual machines", + rest = "from the command line and shell scripts." }, + { difficulty = 1, cmdline = 1, + name = "start-stop-vm-with-command-line", + link = "Start and stop virtual machines", + rest = "from the command line and shell scripts." }, + { difficulty = 1, cmdline = 1, + name = "check-hardware-virt", + link = "Check if your hardware supports virtualization.", + rest = "Hardware virtualization is supported by many but not all + modern hardware. If enabled it offers great performance + benefits. This article explains the different types of + hardware virtualization and how to check if your hardware + supports it." }, + { difficulty = 3, cmdline = 1, + name = "install-with-command-line", + link = "Install a virtual machine", + rest = "using the command line. Create a VM from the command line + and shell scripts." }, + { difficulty = 5, cmdline = 1, + author = "Richard W.M. Jones", date = "2010-10-12", + name = "advanced-virt-df", + link = "Advanced use of virt-df.", + rest = "Check free disk space. Regularly check from a cron job, + draw graphs to predict future usage, and generate alerts + if VMs are running low on space." }, +] + +# NB: Make sure you don't add blank lines to the end of this file! +-%] diff --git a/website/templates/google_analytics b/website/templates/google_analytics new file mode 100644 index 0000000..2c881d1 --- /dev/null +++ b/website/templates/google_analytics @@ -0,0 +1,14 @@ +[%# Google analytics for tracking. + Ask RWMJ for access to the account. %] + + diff --git a/website/templates/h2 b/website/templates/h2 new file mode 100644 index 0000000..d5f7db1 --- /dev/null +++ b/website/templates/h2 @@ -0,0 +1,11 @@ +

    +[%- IF anchor -%] + +[%- END -%] +[% h2 %] +[%- IF anchor -%] + # +[%- END -%] +

    + +[% content %] diff --git a/website/templates/page b/website/templates/page new file mode 100644 index 0000000..93dd573 --- /dev/null +++ b/website/templates/page @@ -0,0 +1,56 @@ + + + +[% title %] + + + +[% IF local_stylesheet %][% END %] + + + +

    [% h1 %]

    + +[% IF topdir == "../.." -%] +

    +(from [% section_titles.$section %]) +

    +[%- END %] + + + +[% content %] + +[% IF topdir == "../.." -%] +

    +Back to [% section_titles.$section %]. +

    +[%- END %] + +

    +Copyright © [% year %] Red Hat Inc. — +License: GPLv2+ — +Last updated on [% printable_date %] +

    + +[%- INCLUDE google_analytics -%] + + diff --git a/website/templates/ttree.conf b/website/templates/ttree.conf new file mode 100644 index 0000000..69eea7c --- /dev/null +++ b/website/templates/ttree.conf @@ -0,0 +1,10 @@ +ignore = ~$ +copy = \.(gif|png|jpg|pdf)$ +recurse +verbose + +lib = templates +src = src +dest = build + +depend *=globals,page,h2 -- cgit