OSVDC Series: Building Your First oVirt Virtual Machine - rharmonson/richtech GitHub Wiki
Revised: October 15, 2017; added details on virtio-win & guest tools
Revised: September 7, 2016; added references to CentOS 7.2.1511 build and template articles
Revised: June 25, 2016; added scp
example
Article 11 of the Open Source Virtual Data Center Series
The purpose of this guide is to provide the basics of building your first virtual machine using oVirt.
oVirt's Quick Start Guide provides guidance on engine-iso-uploader.
If using the oVirt Manager appliance, I would advise using the ovirt-iso-uploader
from a Compute host.
Reference: http://www.ovirt.org/documentation/quickstart/quickstart-guide/
Connect to either node1 or node2, then install ovirt-iso-uploader
.
[root@node1 ~]# yum install ovirt-iso-uploader
Results with
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
ovirt-iso-uploader noarch 3.6.0-1.el7.centos ovirt-3.6 37 k
Transaction Summary
================================================================================
Install 1 Package
Total download size: 37 k
Installed size: 110 k
Is this ok [y/d/N]:
Edit isouploader.conf
to reflect your environment to simplify use of ovirt-iso-uploader or specify at execution. Use ovirt-iso-uploader -h
for details on the options and format. As an example, my isouploader.conf is given below.
[root@node1 ~]# cat /etc/ovirt-engine/isouploader.conf
[ISOUploader]
#
### oVirt Engine Configuration:
#
## username to use with the REST API
user=admin@internal
# the oVirt Engine REST API password.
#passwd=
## hostname or IP address of the oVirt Engine
engine=192.168.101.21:443
## CA certificate used to validate the engine.
#cert-file=/etc/pki/ovirt-engine/ca.pem
#
### ISO Storage Domain Configuration
## the ISO domain to which the file(s) should be uploaded
iso-domain=isodom
## the NFS server to which the file(s) should be uploaded.
##nfs-server=example.com:/path/to/some/dir
##
#
### SSH Configuration
## the SSH user that the program will use for SSH file transfers.
#ssh-user=USER
## the port to ssh and scp on
#ssh-port=22
## the identity file (private key) to be used for accessing the file server.
#key-file=KEYFILE
Test by executing ovirt-iso-uploader. Note the --insecure is to ovoid [ERROR]::oVirt API connection failure
due to the self-signed SSL certificate.
[root@node1 tmp]# ovirt-iso-uploader --insecure list
Please provide the REST API password for the admin@internal oVirt Engine user (CTRL+D to abort):
ISO Storage Domain Name | Datacenter | ISO Domain Status
isodom | Default | active
If you have ISO media available via NFS, mount the export or use scp
. Generally, I cd
to /tmp
and copy using the syntax below.
scp root@[IP Address or Host Name]:/path/to/file.iso .
Otherwise, obtain the media using curl
. Many web sites use redirects, so use the -L
option to permit redirects. The -O
uses the remote file name or you can use -o
to specify a different file name as the output.
[root@node1 ~]# cd /tmp
[root@node1 tmp]# curl -L -O https://download.fedoraproject.org/pub/fedora/linux/releases/23/Workstation/x86_64/iso/Fedora-Live-Workstation-x86_64-23-10.iso
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 1401M 100 1401M 0 0 2781k 0 0:08:35 0:08:35 --:--:-- 2787k
[root@node1 tmp]#
Upload the Fedora ISO image.
[root@node1 tmp]# ovirt-iso-uploader --insecure upload Fedora-Live-Workstation-x86_64-23-10.iso
Please provide the REST API password for the admin@internal oVirt Engine user (CTRL+D to abort):
Uploading, please wait...
INFO: Start uploading Fedora-Live-Workstation-x86_64-23-10.iso
Uploading: [########################################] 100%
INFO: Fedora-Live-Workstation-x86_64-23-10.iso uploaded successfully
[root@node1 tmp]#
Reviewing the changes in oVirt, select "Storage," the ISO domain "isodom," then in the details pane select "Images." The Fedora ISO image should be displayed.
Note
You could mount the NFS export for the ISO Storage domain using an administrator workstation and copy ISO images. However, you will need to chown vdsm:kvm
and chmod 640
the files. The directory path will look something like the example given below. Right now, my thought is I will be using the ovirt-iso-uploader for new ISO images, but for my existing repository of ISO images, it is simpler to copy the entire contents, chown, then chmod.
Example to oVirt's ISO Storage Domain Path
/mnt/r10vol/iso/14f43d67-883d-424d-b194-dbbf3abbaaaa/images/11111111-1111-1111-1111-111111111111/<file.iso>
Creating a Fedora 23 Workstation, I used the following settings:
- Connect to oVirt and authenticate to the Administration Portal
- Select "Virtual Machines" tab
- Select "New VM" button
- Cluster "Default" or you data center (default)
- Template: Blank (default)
- Operating System: Red Hat Enterprise Linux 7.x x64
- Instance Type: Custom (default)
- Optimize for: Desktop (default)
- Name: wsadmin
- VM Id:
- Description: Fedora 23
- Comment: Administrator workstation
- Select "Create" for Instance Images
- Size(GB): 30
- Select "OK" to accept the defaults for remaining items
- nic1: vm101/infra101
- Note "Console" on the side-bar but accept the default of 1 monitor
- Select "Show Advanced Options"
- Select "System" on the side-bar
- Memory: 2048
- Total Virtual CPUs: 2
- Time Zone:
- Select "Boot Options" from the side-bar
- Second Device: CD-ROM
- Check-mark "Attach CD"
- Select Fedora-Live-Workstation-x86_64-23-10.iso
- Select "OK"
- Select and right-mouse click "wsadmin" virtual machine then select "Run"
- Right-mouse click and select "Console"
- Once connected to wsadmin, complete the Fedora installation.
Note
Due to the absence of DNS on the cluster, the "console.vv" file that is used to provide the console connection parameters will not work without editing. Simply replace the Compute host's host name with its IP address then launch.
If using Windows as a client, I would advise download the "VirtView" installer from https://www.virt-manager.org/download/.
Complete a base build as described here:
Complete the sealing process and convert to template:
Building Windows differ in that you must supply drivers at installation time. This is how I do it.
Connect to the oVirt Engine via SSH, then
# yum install virtio-win
# engine-iso-uploader --iso-domain=[YourISODomain] upload /usr/share/virtio-win/virtio-win_amd64.vfd
Create your virtual machine, then select "Run Once" using the virtio-win_am64.vfd floppy and Windows installation DVD ROM. This will provide all the necessary drivers to complete the installation.
Once the installation is complete, reboot, then install the oVirt Guest Tools.
# yum install ovirt-guest-tools-iso
# engine-iso-uploader --iso-domain=[YourISODomain] upload /usr/share/ovirt-guest-tools-iso/ovirt-tools-setup.iso
The oVirt Guest Tools, also, contains additional virtio-win drivers. The primary symptom of not having the Guest Tools installed is mouse pointer not being correctly grabbed and released.
At this point, I would advise building one or two DNS hosts that can resolve Compute and Storage hosts and the oVirt Manager. It will simplify management of the cluster and services provided by your future virtual machines. Once built, I would continue to use /etc/hosts for resolving cluster hosts and the appliance, but update our use of 8.8.8.8 to the new DNS virtual machine's IP address.
Next article in the series is oVirt 3.6 Cluster Upgrade.