<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Getting started on OpenShift Virtualization Training</title><link>/docs/getting-started-with-kubevirt/</link><description>Recent content in Getting started on OpenShift Virtualization Training</description><generator>Hugo</generator><language>en</language><atom:link href="/docs/getting-started-with-kubevirt/index.xml" rel="self" type="application/rss+xml"/><item><title>Create a VM</title><link>/docs/getting-started-with-kubevirt/create-vm/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/docs/getting-started-with-kubevirt/create-vm/</guid><description>&lt;h2 id="creating-a-virtual-machine">Creating a virtual machine&lt;/h2>
&lt;p>In OpenShift&amp;rsquo;s web console in the menu on the left, navigate to &lt;strong>Virtualization&lt;/strong> → &lt;strong>Overview&lt;/strong>. Make sure your project is active:&lt;/p>
&lt;p>&lt;img alt="Project dropdown" src="../openshift-project-dropdown.png">&lt;/p>
&lt;p>It&amp;rsquo;s still pretty empty here and a lot of zeroes look at us. However, we are going to change this.&lt;/p>
&lt;h3 id="task-111-create-your-first-virtual-machine">Task 1.1.1: Create your first virtual machine&lt;/h3>
&lt;p>Open the &lt;strong>VirtualMachines&lt;/strong> menu entry. Click on &lt;strong>Create VirtualMachine&lt;/strong> and choose &lt;strong>From template&lt;/strong>.&lt;/p>
&lt;p>On the left of the view that just opened, click on &lt;strong>User templates&lt;/strong> and choose the &lt;strong>Cirros VM&lt;/strong> template.&lt;/p></description></item><item><title>Start and stop a VM</title><link>/docs/getting-started-with-kubevirt/lifecycle/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/docs/getting-started-with-kubevirt/lifecycle/</guid><description>&lt;p>In the previous section, we wrote a VirtualMachine specification and applied the manifest to the Kubernetes cluster.&lt;/p>
&lt;h2 id="lifecycle">Lifecycle&lt;/h2>
&lt;p>When the underlying technology &lt;code>libvirt&lt;/code> refers to a VM it often also uses the concept of so-called &lt;em>guest domains&lt;/em>.&lt;/p>
&lt;p>According to &lt;a href="https://wiki.libvirt.org/VM_lifecycle.html" target="_blank" rel="noopener">libvirt.org&lt;/a>
, a guest domain can be in several states:&lt;/p>
&lt;ol>
&lt;li>&lt;strong>Undefined&lt;/strong>: This is a baseline state. Libvirt does not know anything about domains in this state because the domain hasn&amp;rsquo;t been defined or created yet.&lt;/li>
&lt;li>&lt;strong>Defined&lt;/strong> or &lt;strong>Stopped&lt;/strong>: The domain has been defined but it&amp;rsquo;s not running. This state is also called stopped. Only persistent domains can be in this state. When a transient domain is stopped or shut down, it ceases to exist.&lt;/li>
&lt;li>&lt;strong>Running&lt;/strong>: The domain has been created and started either as transient or persistent domain. Either domain in this state is being actively executed on the node&amp;rsquo;s hypervisor.&lt;/li>
&lt;li>&lt;strong>Paused&lt;/strong>: The domain execution on the hypervisor has been suspended. Its state has been temporarily stored until it is resumed. The domain does not have any knowledge whether it was paused or not.&lt;/li>
&lt;li>&lt;strong>Saved&lt;/strong>: Similar to the paused state, but the domain state is stored to persistent storage. Again, the domain in this state can be restored and it does not notice that any time has passed.&lt;/li>
&lt;/ol>
&lt;p>&lt;img alt="VM Lifecycle" src="../vm_lifecycle_graph.png">&lt;/p></description></item><item><title>Accessing the console</title><link>/docs/getting-started-with-kubevirt/console/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/docs/getting-started-with-kubevirt/console/</guid><description>&lt;h2 id="console-access">Console access&lt;/h2>
&lt;p>Make sure you are on your VM&amp;rsquo;s details page and that it is started.&lt;/p>
&lt;p>Now open your VM&amp;rsquo;s console by clicking on &lt;strong>Open web console&lt;/strong>.
A new window opens. Wait for the console to connect.&lt;/p>
&lt;p>&lt;img alt="VNC web console" src="../openshift-console.png">&lt;/p>
&lt;p>You can now use the default credentials to log in:&lt;/p>
&lt;ul>
&lt;li>User: &lt;code>cirros&lt;/code>&lt;/li>
&lt;li>Password: &lt;code>gocubsgo&lt;/code>&lt;/li>
&lt;/ul>
&lt;p>Try executing a couple of commands, such as:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>whoami
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>ping tim-koko.ch
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="task-132-entering-the-console-using-virtctl">Task 1.3.2: Entering the console using virtctl&lt;/h3>
&lt;p>By executing the following command in your openshift terminal, you can also use the &lt;code>virtctl&lt;/code> cli to conncet to the virtual machines console:&lt;/p></description></item><item><title>Exposing VM Ports</title><link>/docs/getting-started-with-kubevirt/ssh/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/docs/getting-started-with-kubevirt/ssh/</guid><description>&lt;p>In the previous chapter, we accessed our VM console using the &lt;code>virtctl&lt;/code> tool. In this section we will expose the SSH port
of our VM and access it directly.&lt;/p>


&lt;div class="alert alert-info" role="alert">
&lt;h4 class="alert-heading">Note&lt;/h4>

This can be done for any port you want to use. For example, if your virtual machine provides a webserver, you can expose
the webserver port.

&lt;/div>

&lt;h2 id="checking-available-services-resources">Checking available Services resources&lt;/h2>
&lt;p>As you see with the following command, creating the VM does not create any Kubernetes Service for it.&lt;/p></description></item><item><title>Changing files</title><link>/docs/getting-started-with-kubevirt/vm-changes/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/docs/getting-started-with-kubevirt/vm-changes/</guid><description>&lt;p>In the previous chapter, we gained access to the VM&amp;rsquo;s console. In this chapter, we will use this access to make a change
to our running VM and observe what happens if we restart the VM.&lt;/p>
&lt;h3 id="task-151-create-a-file">Task 1.5.1: Create a file&lt;/h3>
&lt;p>Connect to your VM&amp;rsquo;s web console.&lt;/p>
&lt;p>Login with the specified credentials and create a file:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>touch myfile
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Verify that the file really is present. Check it with:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>stat myfile
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="task-152-restart-vm">Task 1.5.2: Restart VM&lt;/h3>
&lt;p>Exit the console and restart your VM.&lt;/p></description></item></channel></rss>