Skip to content
This repository has been archived by the owner on Nov 20, 2023. It is now read-only.

Libvirt provider - OpenShift installation (step 3/4) #354

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

ericzolf
Copy link
Contributor

What does this PR do?

Libvirt provider working up to installation of OpenShift on the 3 foreseen nodes. Connection to master web console works. oc adm diagnostics spits a few errors but nothing completely wrong (need to look into it though).

How should this be manually tested?

Follow the instructions of PROVISIONING_LIBVIRT.adoc up and including chapter 'install'.

Is there a relevant Issue open for this?

n/a

Other Relevant info, PRs, etc.

based on #353 and #352

Who would you like to review this?

cc: @redhat-cop/casl

procrypt and others added 14 commits January 14, 2019 17:57
* WIP: Provisioning an OpenShift Cluster on Libvirt

* remove symlink

* remove test user from ks files

* remove yml file

* edit inventry file

* modify the host_vars

* edit ks file path file

* modify inventory and playbook
stopped VMs are silently ignored, works with Python3,
add environment variables to configure script in regard to
connection uri, VMs filtering and variables prefix in inventory.
…al network used.

This makes it easier to avoid collisions with already existing networks.
The playbook `provision.yml` runs through and 3 hosts are created but there
is more to do in terms of storage and DNS/network setup to make it workable
for OpenShift is my strong assumption.
oreg variables to pull the OpenShift images.
ignore memory and disk space checks.
Copy link
Contributor

@InfoSec812 InfoSec812 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ericzolf I'm trying to test your PR on my KVM infra at home and I keep running into issues (Could be I'm not understanding something correctly)..

sudo ip address add 192.168.123.254 dev dummy0 # <1>
sudo ip address show dev dummy0 up
------------------------------------------------------------------------
<1> the IP-address must be the one you've entered as forwarder for the apps wildcard DNS in your network XML.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No explanation of what that Network XML should be or what it should contain?

Start dnsmasq against this interface, defining our wildcard DNS domain *.apps.local

------------------------------------------------------------------------
sudo dnsmasq --interface=dummy0 --no-daemon --log-queries=extra \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explain that this is only required if you do not have an existing DNS server with records for your hosts?


=== Create a separate network

Call `sudo virsh net-create --file libvirt-network-definition.xml`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Provide an example for what this XML file should look like?


=== provision-instances

- make sure `/dev/loopN` isn't mounted on `/var/www/html/installXXX`, and remove it from your `/etc/fstab` if you try multiple times with errors (something to FIXME).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this for?

- export the variable `LIBVIRT_INV_VM_FILTER` to fit the libvirt names defined for your cluster's VMs, e.g. `export LIBVIRT_INV_VM_FILTER=^ocp_`.
- if your network isn't persistent create it (see above).
- make sure that `/tmp/authorized_keys` exists. FIXME: not sure yet for which use cases it is required, I just copy for now my own authorized keys.
- call `ansible-playbook -i ../../inventory/sample.libvirt.example.com.d/inventory libvirt/provision.yml`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May need to add -b to the ansible-playbook command if your user does not have permissions to virsh on the target KVM host.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, you should be clear about which directory to run this command from or rewrite this step to be run from the root of the project.

=== install

- make sure the credentials are set in the environment, either using your RHSM credentials or adding specific ones (OREG_AUTH_USER and OREG_AUTH_PASSWORD, see inventory OSEv3.yml for details).
- call `ansible-playbook -i ../../inventory/sample.libvirt.example.com.d/inventory/ install.yml` and wait...
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From which directory do we run this?


[source,bash]
----
docker run -u `id -u` \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need an AWS Access key/secret? Why are we running this from Docker when all other Ansible commands have been run without Docker?

libvirt_vcpus: "1"
libvirt_disk_size: "15"
libvirt_os_variant: "rhel7"
libvirt_iso: "~/Downloads/rhel-server-7.5-x86_64-dvd.iso"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On which host does this file need to exist?

@@ -0,0 +1,44 @@
[infra]
cloud-host.local
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a comment here to explain that this is the KVM host machine?

Add a comment about possibly adding ansible_become=true as a var?

[infra]
cloud-host.local

[infra_vms]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How are users of this playbook supposed to define how much CPU and RAM each VM will be allocated?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants