Compare languages | Cloud provider — VMware Cloud Director: подготовка окружения.

Список необходимых ресурсов VCD

List of required VCD resources

  • Organization
  • VirtualDataCenter
  • vApp
  • StoragePolicy
  • SizingPolicy
  • Network
  • EdgeRouter
  • Catalog
  • Organization
  • VirtualDataCenter
  • vApp
  • StoragePolicy
  • SizingPolicy
  • Network
  • EdgeRouter
  • Catalog

Ресурсы Organization, VirtualDataCenter, StoragePolicy, SizingPolicy, EdgeRouter и Catalog должны быть предоставлены вашим поставщиком услуг VMware Cloud Director.

The Organization, VirtualDataCenter, StoragePolicy, SizingPolicy, EdgeRouter, and Catalog resources must be provided by your VMware Cloud Director service provider.

Network (внутренняя сеть) может быть настроена вашим поставщиком услуг VMware Cloud Director, либо вы можете настроить ее самостоятельно. Далее рассматривается настройка внутренней сети самостоятельно.

Network (internal network) can be configured by your VMware Cloud Director service provider, or you can configure it yourself. The following sections describe how you can configure the internal network.

Права пользователя

User permissions

Пользователь, под которым будет осуществляться доступ к API VMware Cloud Director, должен иметь следующие права:

The user accessing the VMware Cloud Director API must have the following permissions:

  • роль Organization Administrator с дополнительным правилом Preserve All ExtraConfig Elements During OVF Import and Export;
  • правило Preserve All ExtraConfig Elements During OVF Import and Export должно быть продублировано в используемом Right Bundle пользователя.
  • The role of Organization Administrator with the additional permission Preserve All ExtraConfig Elements During OVF Import and Export.
  • The permission Preserve All ExtraConfig Elements During OVF Import and Export must be duplicated in the user’s Right Bundle.

Добавление сети

Adding a network

  1. Перейдите на вкладку Networking и нажмите NEW:
  1. Go to the Networking tab and click NEW:

Добавление сети, шаг 1

Adding a network, step 1

  1. Выберите необходимый Data Center:
  1. Select the Data Center:

Добавление сети, шаг 2

Adding a network, step 2

  1. На этапе Network type выберите Routed:
  1. At the Network type step, select Routed:

Добавление сети, шаг 3

Adding a network, step 3

  1. Присоедините EdgeRouter к сети:
  1. Connect EdgeRouter to the network:

Добавление сети, шаг 4

Adding a network, step 4

  1. Укажите имя сети и CIDR:
  1. Specify the network name and CIDR:

Добавление сети, шаг 5

Adding a network, step 5

  1. Не добавляйте Static IP Pools, поскольку будет использоваться DHCP:
  1. Do not add Static IP Pools because DHCP will be used:

Добавление сети, шаг 6

Adding a network, step 6

  1. Укажите адреса DNS-серверов:
  1. Specify the DNS server addresses:

Добавление сети, шаг 7

Adding a network, step 7

Настройка DHCP

Configuring DHCP

Для динамического заказа узлов включите DHCP-сервер для внутренней сети.

To provision nodes dynamically, enable the DHCP server for the internal network.

Рекомендуем выделить начало диапазона адресов сети на системные нагрузки (control plane, frontend-узлы, системные узлы), а остальное выделить на DHCP-пул. Например, для сети по маске /24 будет достаточно выделения 20 адресов под системные нагрузки.

We recommend allocating the beginning of the network address range to system consumers (control plane, frontend nodes, system nodes) and the rest to the DHCP pool. For example, for a /24 mask network it would be enough to allocate 20 addresses to system consumers.

  1. Перейдите на вкладку Networking и откройте созданную сеть:
  1. Click the Networking tab and open the network you created:

DHCP, шаг 1

DHCP, step 1

  1. В открывшемся окне выберите пункт IP Management -> DHCP -> Activate:
  1. In the opened window, select IP Management -> DHCP -> Activate:

DHCP, шаг 2

DHCP, step 2

  1. На вкладке General settings настройте параметры аналогично примеру:
  1. In the General settings tab, set the parameters as shown in the example:

DHCP, шаг 3

DHCP, step 3

  1. Добавьте пул:
  1. Add a pool:

DHCP, шаг 3

DHCP, step 3

  1. Укажите адреса DNS-серверов:
  1. Set the DNS server addresses:

DHCP, шаг 3

DHCP, step 3

Добавление vApp

Adding a vApp

  1. Перейдите на вкладку Data Centers -> vApps -> NEW -> New vApp:
  1. Switch to the Data Centers tab -> vApps -> NEW -> New vApp:

Добавление vApp, шаг 1

Adding a vApp, step 1

  1. Укажите имя и включите vApp:
  1. Specify a name and enable the vApp:

Добавление vApp, шаг 2

Adding a vApp, step 2

Добавление сети к vApp

Adding a network to the vApp

После создания vApp присоедините к ней созданную внутреннюю сеть.

Once the vApp is created, connect the created internal network to it.

  1. Перейдите на вкладку Data Centers -> vApps и откройте необходимый vApp:
  1. Switch to the Data Centers tab -> vApps and open the target vApp:

Добавление сети к vApp, шаг 1

Adding a network to the vApp, step 1

  1. Перейдите на вкладку Networks и нажмите NEW:
  1. Go to the Networks tab and click NEW:

Добавление сети к vApp, шаг 2

Adding a network to the vApp, step 2

  1. В появившемся окне выберите тип Direct и выберите сеть:
  1. In the opened window, click the Direct type and select the network:

Добавление сети к vApp, шаг 3

Adding a network to the vApp, step 3

Входящий трафик

Incoming traffic

Входящий трафик необходимо направить на edge router (порты 80, 443) при помощи правил DNAT на выделенный адрес во внутренней сети. Этот адрес поднимается при помощи MetalLB в L2-режиме на выделенных frontend-узлах.

Incoming traffic should be routed to the edge router (ports 80, 443) using DNAT rules to be forwarded to a dedicated address on the internal network.
This address can be created by running MetalLB in L2 mode for dedicated frontend nodes.

Настройка правил DNAT/SNAT на edge gateway

Configuring DNAT/SNAT rules on the edge gateway

  1. Перейдите на вкладку Networking -> Edge Gateways, откройте edge gateway:
  1. Navigate to the Networking tab -> Edge Gateways and open the edge gateway:

Настройка правил DNAT на edge gateway, шаг 1

Configuring DNAT rules on the edge gateway, step 1

  1. Перейдите на вкладку Services -> NAT:
  1. Switch to the Services tab -> NAT:

Настройка правил DNAT на edge gateway, шаг 2

Configuring DNAT rules on the edge gateway, step 2

  1. Добавьте следующие правила:
  1. Add the following rules:

Настройка правил DNAT на edge gateway, шаг 3

Configuring DNAT rules on the edge gateway, step 3

Первые два правила используются для входящего трафика, а третье — для доступа по SSH к узлу с control plane (без этого правила установка будет невозможна).

The first two rules are used for incoming traffic, while the third rule is used for SSH access to the control plane host (without this rule the installation will not be possible).

  1. Чтобы виртуальные машины могли выходить в интернет, настройте правила SNAT, следуя примеру:
  1. To allow virtual machines to access the internet, configure SNAT rules following the example:

Настройка правил SNAT на edge gateway, шаг 1

Configuring SNAT rules on the edge gateway, step 1

Данное правило позволит виртуальным машинам из подсети 192.168.199.0/24 выходить в интернет.

This rule will allow virtual machines from the 192.168.199.0/24 subnet to access the internet.

Настройка firewall

Configuring a firewall

После настройки DNAT настройте firewall. Сначала необходимо настроить наборы IP-адресов (IP sets).

Once DNAT is configured, set up the firewall. Start by configuring the IP sets.

  1. Перейдите на вкладку Security -> IP Sets:
  1. Switch to the Security tab -> IP Sets:

Настройка firewall на edge gateway, шаг 1

Configuring the edge gateway firewall, step 1

  1. Создайте следующий набор IP (подразумевается, что адрес MetalLB будет .10 а адрес узла с control plane — .2):
  1. Create the following set of IPs (the MetalLB address here is .10 and the control plane node address is .2):

Настройка firewall на edge gateway, шаг 1

Configuring the edge gateway firewall, step 1

Настройка firewall на edge gateway, шаг 1

Configuring the edge gateway firewall, step 1

Настройка firewall на edge gateway, шаг 1

Configuring the edge gateway firewall, step 1

  1. Добавьте следующие правила firewall:
  1. Add the following firewall rules:

Настройка firewall на edge gateway, шаг 1

Configuring the edge gateway firewall, step 1

Шаблон виртуальной машины

Virtual machine template

Работоспособность провайдера подтверждена только для шаблонов виртуальных машин на базе Ubuntu 22.04.

The provider is confirmed to work with Ubuntu 22.04-based virtual machine templates only.

В примере используется OVA-файл, предоставляемый Ubuntu, с двумя исправлениями. Исправления необходимы для корректного заказа CloudPermanent-узлов и для возможности подключать диски, созданные CSI.

The example below uses the OVA file provided by Ubuntu, updated to include two fixes. Those fixes are essential for CloudPermanent nodes to be provisioned correctly and to be able to mount CSI-created disks.

Подготовка шаблона из OVA-файла

Making a template from an OVA file

  1. Скачайте OVA-файл:
  1. Download the OVA file:

Настройка шаблона, шаг 1

Setting up the template, step 1

  1. Перейдите на вкладку Libraries -> Catalogs -> Каталог организации:
  1. Switch to the Libraries tab -> Catalogs -> Organization Catalog:

Настройка шаблона, шаг 2

Setting up the template, step 2

  1. Выберите скачанный шаблон и загрузите его в каталог:
  1. Select the template you downloaded and add it to the catalog:

Настройка шаблона, шаг 3

Setting up the template, step 3

Настройка шаблона, шаг 4

Setting up the template, step 4

Настройка шаблона, шаг 5

Setting up the template, step 5

  1. Создайте виртуальную машину из шаблона:
  1. Create a virtual machine from the template:

Настройка шаблона, шаг 6

Setting up the template, step 6

Настройка шаблона, шаг 7

Setting up the template, step 7

Укажите пароль по умолчанию и публичный ключ. Они понадобятся, чтобы войти в консоль виртуальной машины.

Enter the default password and public key. You will need them to log in to the VM console.

Настройка шаблона, шаг 8

Setting up the template, step 8

Для подключения к виртуальной машине выполните следующие шаги:

Follow these steps to be able to connect to the virtual machine:

  1. Запустите виртуальную машину.
  2. Дождитесь получение IP-адреса.
  3. Пробросьте порт 22 до виртуальной машины:
  1. Start the virtual machine.
  2. Wait for the IP address to be set.
  3. Forward port 22 to the virtual machine:

Настройка шаблона, шаг 9

Setting up the template, step 9

Войдите на виртуальную машину по SSH и выполните следующие команды:

Log on to the virtual machine over SSH and run the following commands:

shell rm /etc/netplan/99-netcfg-vmware.yaml echo -e ‘\n[deployPkg]\nwait-cloudinit-timeout=1800\n’ » /etc/vmware-tools/tools.conf echo ‘disable_vmware_customization: true’ > /etc/cloud/cloud.cfg.d/91_vmware_cust.cfg dpkg-reconfigure cloud-init

shell rm /etc/netplan/99-netcfg-vmware.yaml echo -e ‘\n[deployPkg]\nwait-cloudinit-timeout=1800\n’ » /etc/vmware-tools/tools.conf echo ‘disable_vmware_customization: true’ > /etc/cloud/cloud.cfg.d/91_vmware_cust.cfg dpkg-reconfigure cloud-init

В появившемся диалоговом окне оставьте галочку только у OVF: Reads data from OVF transports. Остальные пункты отключите:

In the dialog box that appears, leave the checkmark only on OVF: Reads data from OVF transports, and make sure to scroll down and remove checkmarks from other options:

Настройка шаблона, OVF

Setting up the template, OVF

Выполните оставшиеся команды:

Execute the remaining commands:

shell truncate -s 0 /etc/machine-id rm /var/lib/dbus/machine-id ln -s /etc/machine-id /var/lib/dbus/machine-id cloud-init clean –logs –seed passwd -d ubuntu passwd -d root rm /home/ubuntu/.ssh/authorized_keys history -c

shell truncate -s 0 /etc/machine-id rm /var/lib/dbus/machine-id ln -s /etc/machine-id /var/lib/dbus/machine-id cloud-init clean –logs –seed passwd -d ubuntu passwd -d root rm /home/ubuntu/.ssh/authorized_keys history -c

shutdown -P now

shutdown -P now

Настройка шаблона в VCD

Setting up the template in VCD

  1. Выключите виртуальную машину и удалите все заполненные поля Guest Properties:
  1. Shut down the virtual machine and clear all populated fields in Guest Properties:

Настройка шаблона, Guest Properties 1

Setting up the template, Guest Properties 1

Настройка шаблона, Guest Properties 5

Setting up the template, Guest Properties 5

  1. Cоздайте шаблон виртуальной машины:
  1. Create a virtual machine template:

Настройка шаблона, шаг 10

Setting up the template, step 10

Настройка шаблона, шаг 11

Setting up the template, step 11

  1. В созданном шаблоне перейдите на вкладку Metadata и добавьте шесть полей:
  1. In the created template, navigate to the Metadata tab and add the following six fields:
  • guestinfo.metadata;
  • guestinfo.metadata.encoding;
  • guestinfo.userdata;
  • guestinfo.userdata.encoding;
  • disk.enableUUID;
  • guestinfo.hostname.
  • guestinfo.metadata
  • guestinfo.metadata.encoding
  • guestinfo.userdata
  • guestinfo.userdata.encoding
  • disk.enableUUID
  • guestinfo.hostname

Настройка шаблона, Guest Properties 2

Setting up the template, Guest Properties 2

Настройка шаблона, Guest Properties 3

Setting up the template, Guest Properties 3

  1. В панели управления vCenter для шаблона включите параметр disk.EnableUUID:
  1. In the vCenter management panel for the template, enable the disk.EnableUUID parameter:

Настройка шаблона, vCenter 1

Setting up the template, vCenter 1

Настройка шаблона, vCenter 2

Setting up the template, vCenter 2

Настройка шаблона, vCenter 3

Setting up the template, vCenter 3

Настройка шаблона, vCenter 4

Setting up the template, vCenter 4

Настройка шаблона, vCenter 5

Setting up the template, vCenter 5

Использование хранилища

Using the storage

  • VCD поддерживает CSI. Диски создаются как VCD Independent Disks.
  • Guest property disk.EnableUUID должно быть разрешено для используемых шаблонов виртуальных машин.
  • Deckhouse Kubernetes Platform поддерживает изменение размера дисков с версии v1.59.1.
  • VCD supports CSI; disks are created as VCD Independent Disks.
  • The disk.EnableUUID guest property must be set for the virtual machine templates in use.
  • Deckhouse Kubernetes Platform supports disk resizing as of v1.59.1.