You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/blog/management-paradigms-for-virtual-machines-running-on-kubernetes.md
+14-14Lines changed: 14 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,9 +21,9 @@ But first, a brief introduction to KubeVirt.
21
21
22
22
KubeVirt provide abstractions to Kubernetes users for Linux Kernel Virtual Machines (KVM). KVM has been around for about two decades now with several successful commercial hypervisors built around the implementation and is at this point considered mature.
23
23
24
-
KubeVirt itself does not have a user interface which most VM administrators are used to. The point of abstraction is through standard Kubernetes tools by manipulating API resources of different Kinds provided by \`CustomResourceDefinitions\` (CRDs).
24
+
KubeVirt itself does not have a user interface which most VM administrators are used to. The point of abstraction is through standard Kubernetes tools by manipulating API resources of different Kinds provided by `CustomResourceDefinitions` (CRDs).
25
25
26
-
The \`CRDs\` allows users to manage VM resources through a set of KubeVirt’s controllers.
26
+
The `CRDs` allows users to manage VM resources through a set of KubeVirt’s controllers.
27
27
28
28

29
29
@@ -107,13 +107,13 @@ It is entirely possible to use `kubectl` out-of-the-box to deploy and manage VM
107
107
108
108
Installing `virtctl` varies by platform and KubeVirt distribution. It’s advised at this point to have the same client and server version which at the time of writing is 1.4.0. If using a Mac with Brew installed, it’s simply:
109
109
110
-
```bash
110
+
```shell
111
111
brew install virtctl
112
112
```
113
113
114
114
First we need to inform ourselves what `DataSources` are available on the cluster. Building new `DataSources` or importing new ones is out of scope for this blog post. VMs are cloned into new `PersistentVolumeClaims` (PVCs) from `DataSources`. List the existing the `DataSources` on the cluster:
Not all `DataSources` are populated by default. On OKD, only “fedora” and “centos-stream9” are available. It can be checked by examining `DataImportCrons`.
Once the VM is running, it’s possible to login with the SSH identity and hostname given to the VM (assuming DHCP registers the hostname in DNS on the management network).
185
185
186
-
```bash
186
+
```shell
187
187
$ ssh fedora@my-vm-0
188
188
[fedora@my-vm-0 ~]$
189
189
```
190
190
191
191
So, what does the VM instance actually look like? Let’s install some tools and inspect.
192
192
193
-
```bash
193
+
```shell
194
194
$ sudo dnf install -yq fastfetch virt-what
195
195
$ sudo virt-what
196
196
redhat
@@ -221,7 +221,7 @@ Except for the “Host” hint, this looks like any VM instance on a KVM hypervi
221
221
222
222
With `virtctl` it’s possible to live migrate, pause/unpause, stop/start and restart the VM. Deleting the VM requires `kubectl`.
223
223
224
-
```bash
224
+
```shell
225
225
kubectl delete -n hpe-vmi vm/my-vm-0
226
226
```
227
227
@@ -253,7 +253,7 @@ Ansible has historically been well integrated with other KVM-based hypervisors s
253
253
254
254
Ansible can be installed on your desktop computer in a multitude of ways and will not be covered in this blog. Once Ansible is in place, install the KubeVirt collection:
255
255
256
-
```bash
256
+
```shell
257
257
ansible-galaxy collection install kubevirt.core
258
258
```
259
259
@@ -335,7 +335,7 @@ Many attributes have been hardcoded in this example but it illustrates the simil
335
335
336
336
Use the playbook to create a VM:
337
337
338
-
```bash
338
+
```shell
339
339
ansible-playbook -e vm=my-vm-0 create_vm.yaml
340
340
```
341
341
@@ -354,7 +354,7 @@ compose:
354
354
355
355
It’s now possible to use the KubeVirt inventory plugin to manage the OS and apps in the VM. Let’s see if it connects:
356
356
357
-
```bash
357
+
```shell
358
358
ansible -i hosts.kubevirt.yaml -m ping my-vm-0
359
359
my-vm-0 | SUCCESS => {
360
360
"ansible_facts": {
@@ -371,4 +371,4 @@ At this point it’s possible to manage the VM like any other host provisioned o
371
371
372
372
It doesn’t matter what your distinct VM management workflow looks like, KubeVirt serves all popular patterns. That said, current tools and processes will require an overhaul and why not switch to idempotent VM management through GitOps while transitioning from your legacy hypervisor? That's a topic for another day.
373
373
374
-
Connect with the HPE Developer Community via [Slack](https://developer.hpe.com/slack-signup/) or sign up for the [Munch & Learn Technology Talks](https://developer.hpe.com/campaign/munch-and-learn/) to immerse yourself in the latest breakthrough technologies from HPE, customers, and partners.
374
+
Connect with the HPE Developer Community via [Slack](https://developer.hpe.com/slack-signup/) or sign up for the [Munch & Learn Technology Talks](https://developer.hpe.com/campaign/munch-and-learn/) to immerse yourself in the latest breakthrough technologies from HPE, customers, and partners.
0 commit comments