To deploy Mirantis Container Cloud on a vSphere-based environment, the OVF template for cluster machines must be prepared according to the following requirements:
The VMWare Tools package is installed.
The cloud-init
utility is installed and configured with the
specific VMwareGuestInfo
data source.
The virt-who
service is enabled and configured
to connect to the VMWare vCenter Server to properly apply the
RHEL subscriptions on the nodes.
The following procedures describe how to meet the requirements above either using the Container Cloud script or manually.
To prepare the OVF template using the Container Cloud script:
Prepare the Container Cloud bootstrap and modify
templates/vsphere/vsphere-config.yaml.template
and
templates/vsphere/cluster.yaml.template
as described in Bootstrap a management cluster, steps 1-9.
Download the RHEL 7.8 DVD ISO from the RedHat Customer Portal.
Export the following variables:
The virt-who
user name and password
The path to the RHEL 7.8 DVD ISO file
The vSphere cluster name
For example:
export KAAS_VSPHERE_ENABLED=true
export VSPHERE_RO_USER=virt-who-user
export VSPHERE_RO_PASSWORD=virt-who-user-password
export VSPHERE_PACKER_ISO_FILE=$(pwd)/rhel-7.8.dvd.iso
export VSPHERE_CLUSTER_NAME=vsphere-cluster-name
Variable |
Description |
---|---|
|
Network interface name in a RHEL virtual machine. Defaults to |
|
Time zone for virtual machines. Defaults to |
Optional. If you require all Internet access to go through a proxy server,
in bootstrap.env
, add the following environment variables:
HTTP_PROXY
HTTPS_PROXY
NO_PROXY
Example snippet:
export HTTP_PROXY=http://proxy.example.com:3128
export HTTPS_PROXY=http://user:pass@proxy.example.com:3128
export NO_PROXY=172.18.10.0,registry.internal.lan
The following variables formats are accepted:
Variable |
Format |
---|---|
|
|
|
Comma-separated list of IP addresses or domain names |
For the list of Mirantis resources and IP addresses to be accessible from the Container Cloud clusters, see Reference Architecture: Hardware and system requirements.
Prepare the OVF template:
./bootstrap.sh vsphere_template
After the template is prepared, set the SET_VSPHERE_TEMPLATE_PATH
parameter in templates/vsphere/machines.yaml.template
as described
in Bootstrap a management cluster.
To prepare the OVF template manually:
Run a virtual machine on the vSphere data center from the official RHEL 7.8 server image. Specify the amount of resources that will be used in the Container Cloud setup. A minimal resources configuration must match the requirements for a vSphere-based Container Cloud cluster.
Select minimal setup in the VM installation configuration. Create a user with root or sudo permissions to access the machine.
Log in to the VM when it starts.
Optional. If you require all Internet access to go through a proxy server,
in bootstrap.env
, add the following environment variables:
HTTP_PROXY
HTTPS_PROXY
NO_PROXY
Example snippet:
export HTTP_PROXY=http://proxy.example.com:3128
export HTTPS_PROXY=http://user:pass@proxy.example.com:3128
export NO_PROXY=172.18.10.0,registry.internal.lan
The following variables formats are accepted:
Variable |
Format |
---|---|
|
|
|
Comma-separated list of IP addresses or domain names |
For the list of Mirantis resources and IP addresses to be accessible from the Container Cloud clusters, see Reference Architecture: Hardware and system requirements.
Attach your RHEL license for Virtual Datacenters to the VM:
subscription-manager register
# automatic subscription selection:
subscription-manager attach --auto
# or specify pool id:
subscription-manager attach --pool=<POOL_ID>
# verify subscription status
subscription-manager status
Select from the following options:
Prepare the operating system automatically:
Download the automation script:
curl https://gerrit.mcp.mirantis.com/plugins/gitiles/kubernetes/vmware-guestinfo/+/refs/tags/ v1.1.1/install.sh?format=TEXT | \
base64 -d > install.sh
chmod +x install.sh
Export the vCenter Server credentials of the read-only user. For example:
export VC_SERVER='vcenter1.example.com'
export VC_USER='domain\vmware_read_only_username'
export VC_PASSWORD='password!23'
# optional parameters:
export VC_HYPERVISOR_ID=hostname
export VC_FILTER_HOSTS="esx1.example.com, esx2.example.com"
export VCENTER_CONFIG_PATH="/etc/virt-who.d/vcenter.conf"
Run the installation script:
./install.sh
Prepare the operating system manually:
Install open-vm-tools
:
yum install open-vm-tools -y
Install and configure cloud-init
:
Download the VMwareGuestInfo
data source files:
curl https://gerrit.mcp.mirantis.com/plugins/gitiles/kubernetes/vmware-guestinfo/+/refs/tags/v1.1.1/DataSourceVMwareGuestInfo.py?format=TEXT | \
base64 -d > DataSourceVMwareGuestInfo.py
curl https://gerrit.mcp.mirantis.com/plugins/gitiles/kubernetes/vmware-guestinfo/+/refs/tags/v1.1.1/99-DataSourceVMwareGuestInfo.cfg?format=TEXT | \
base64 -d > 99-DataSourceVMwareGuestInfo.cfg
Add 99-DataSourceVMwareGuestInfo.cfg
to /etc/cloud/cloud.cfg.d/
.
Depending on the Python version on the VM operating system,
add DataSourceVMwareGuestInfo.py
to the cloud-init
sources
folder.
Obtain the cloud-init
folder on RHEL:
yum install cloud-init -y
python -c 'import os; from cloudinit import sources; print(os.path.dirname(sources.__file__));'
Prepare the virt-who
user configuration:
Note
For details about the virt-who
user creation,
see Prepare the VMWare deployment user setup and permissions.
Install virt-who
:
yum install virt-who -y
cp /etc/virt-who.d/template.conf /etc/virt-who.d/vcenter.conf
Set up the file content using the following example:
[vcenter]
type=esx
server=vcenter1.example.com
username=domain\vmware_read_only_username
encrypted_password=bd257f93d@482B76e6390cc54aec1a4d
owner=1234567
hypervisor_id=hostname
filter_hosts=esx1.example.com, esx2.example.com
Parameter |
Description |
---|---|
|
Name of the vCenter data center. |
|
Specifies the connection of the defined |
|
The FQDN of the vCenter Server. |
|
The |
|
The |
|
The organization that the hypervisors belong to. |
|
Specifies how to identify the hypervisors. Use a host name
to provide meaningful host names to the Subscription Management.
Alternatively, use |
|
List of hypervisors that never run RHEL VMs.
Such hypervisors do not have to be reported by |
Remove the RHEL subscription from the node.
subscription-manager remove --all
subscription-manager unregister
subscription-manager clean
Shut down the VM.
Create an OVF template from the VM.
Now, proceed to Bootstrap a management cluster.