Skip to content

User Guide

Once the zPodFactory framework is deployed and running, and has been configured by an Administrator you can start using the CLI to deploy nested environments.

Introduction

zcli is a command line tool that allows you to manage your zPods and the whole zPodFactory framework.

CLI Installation

Using pip:

❯ pip install zpodcli

Verify that the CLI is now available and working:

❯ zcli

 Usage: zcli [OPTIONS] COMMAND [ARGS]...

╭─ Options ───────────────────────────────────────────────────────────────────╮
│ --factory             -f      TEXT  Use specific factory for this commmand. │
│ --output-svg                        Output an SVG file for any list command.│
│ --version             -V            Display version information.            │
│ --install-completion                Install completion for this shell.      │
│ --help                              Show this message and exit.             │
╰─────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ──────────────────────────────────────────────────────────────────╮
│ component                          Manage Components                        │
│ endpoint                           Manage Endpoints                         │
│ enet                               Manage ENets                             │
│ factory                            Manage Factories                         │
│ group                              Manage Permission Groups                 │
│ library                            Manage Libraries                         │
│ profile                            Manage Profiles                          │
│ setting                            Manage Settings                          │
│ user                               Manage Users                             │
│ zpod                               Manage zPods                             │
╰─────────────────────────────────────────────────────────────────────────────╯

Authentication

The first thing you need to do is to connect to the zPodFactory API with the token an Administrator provided you.

❯ zcli factory add myfactory -s http://zpodfactory.domain.lab:8000 -t "TOKEN" -a

Verify that the connection was successfull and that you are connected to the API:

❯ zcli user list

                                                   User List                                                    ┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓ Username Email                   DescriptionCreation Date      Last Connection    Superadmin ┡━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩ superusersuperuser@zpodfactory.io2024-03-15 21:39:582024-05-09 14:38:38True └───────────┴──────────────────────────┴─────────────┴─────────────────────┴─────────────────────┴────────────┘

Manage zPods

zPods are the nested environments name in the zPodFactory framework.

List zPods

❯ zcli zpod list

                                                             zPod List                                                              ┏━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━┓ Name    Domain           Profile    ComponentsEndpoint   Networks           Owner(s) Password    Status ┡━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━┩ demo.vcfdemo.vcf.zpod.labvcf511-mgmt1 x zboxovh-pcc-hci - 10.96.9.0/26superuserzdf!!VG3tqyhACTIVE 4 x esxi - 10.96.9.64/26 1 x vcf - 10.96.9.128/26  - 10.96.9.192/26 ovh.vcfovh.vcf.zpod.labvcf511-mgmt1 x zboxovh-pcc-hci - 10.96.241.0/26superuserN0f!l!xvvjTpACTIVE 4 x esxi - 10.96.241.64/26 1 x vcf - 10.96.241.128/26  - 10.96.241.192/26 packerpacker.zpod.labpacker1 x zboxovh-pcc-hci - 10.96.230.0/26superuser!Z7ys!avqEesACTIVE 1 x esxi - 10.96.230.64/26  - 10.96.230.128/26  - 10.96.230.192/26 spacexspacex.zpod.labsddc1 x zboxovh-pcc-hci - 10.96.48.0/26superuserrf!djG7wuztmACTIVE 3 x esxi - 10.96.48.64/26 1 x vcsa - 10.96.48.128/26 1 x nsx - 10.96.48.192/26 └──────────┴───────────────────┴─────────────┴────────────┴─────────────┴─────────────────────┴───────────┴──────────────┴────────┘

Create zPods

To create a zPod you will need to provide a few parameters:

  • name: The name of the zPod
  • profile: The profile to use to deploy the zPod (use zcli profile list to list available profiles)
  • endpoint: The endpoint to use to deploy the zPod (use zcli endpoint list to list available endpoints)
❯ zcli zpod create name -p profile -e endpoint

For example:

❯ zcli zpod create test -p base -e sddc-lab

This will create a zPod with the following attributes:

  • name: test This will be the name of the zPod, that also means it will concatenate this name with the zpodfactory.domain to create the FQDN of the zPod. In this case it will be test.zpodfactory.domain, and any component, such as zbox component will be zbox.test.zpodfactory.domain.

Info

The zpodfactory.domain is a setting that can ONLY be configured by an Administrator.

It is configured by the zpodfactory_default_domain setting. This setting should be configured at initial setup of this framework and SHOULD NEVER BE MODIFIED.

Check Manage settings for more information.

  • profile: base This is the profile that will be used to deploy the zPod. It will be used to deploy the zbox component, and any other component that is required by the profile. The base profile actually entitles to the following components in our current configuration :

    • zbox-12.7 (mandatory component to manage DNS/DHCP, 3 additional zPod /26 subnets on tagged VLAN 64/128/192, and also the NFS datastore for the nested hosts)
    • esxi-8.0u3c (Host Id: 11, CPU: 4, Mem: 48GB)
    • esxi-8.0u3c (Host Id: 12, CPU: 4, Mem: 48GB)
    • vcsa-8.0u3d

Info

The base profile is a profile that can ONLY be configured by an Administrator. Check Manage profiles for more information.

  • endpoint: sddc-lab will reference the endpoint to use to deploy the zPod. In this case it will be the sddc-lab endpoint that is configured by an Administrator, and should link to the physical environment that will host this zPod nested environment.

Info

The sddc-lab endpoint is an endpoint that can ONLY be configured by an Administrator. Check Manage endpoints for more information.

Accessing the zPod

Once the zPod is deployed, you can access it using the following credentials

for vcsa (VMware vCenter Server):

  • username: administrator@name.zpodfactory.domain
  • password: Each zPod has its password generated. Password can be fetched by using the zcli zpod list command)

For every other component, the username is the default for that component. For example, on many VMware products the default administrator account is either root or admin, such as nsx-v, nsx-t, nsx, vcda, vrops, vrli. However, for vcd, the default administrator account is administrator. The password is always the zPod Password.

Destroy zPods

❯ zcli zpod destroy name

Warning

This will destroy the zPod and all its components without confirmation, and will not be recoverable.

Manage components

In the previous section we deployed a zPod with the base profile, which does not contain many products, but only the bare minimum to have a functional nested environment. Here we will show you how to list the available components, and add a new component to a deployed/available zPod.

List components

❯ zcli component list

                                                                Component List                                                                 ┏━━━━━━━━━━━━━━━━━┳━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━┓ UID            Name Version   LibraryDescription                                                   Download StatusStatus ┡━━━━━━━━━━━━━━━━━╇━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━╇━━━━━━━━┩ esxi-8.0u2-devesxi8.0u2-devdevVMware ESXi Template                                          COMPLETEDACTIVE esxi-8.0u2besxi8.0u2bdefaultVMware ESXi Template                                          COMPLETEDACTIVE esxi-8.0u2b-devesxi8.0u2b-devdevVMware ESXi Template                                          COMPLETEDACTIVE nsx-4.1.2.3nsx4.1.2.3defaultVMware NSX                                                    COMPLETEDACTIVE vcd-10.5.1.1vcd10.5.1.1defaultVMware Cloud Director                                         COMPLETEDACTIVE vcf-5.1vcf5.1defaultVMware Cloud Foundation                                       COMPLETEDACTIVE vcf-5.1.1vcf5.1.1defaultVMware Cloud Foundation                                       COMPLETEDACTIVE vcsa-8.0u2bvcsa8.0u2bdefaultVMware vCenter Server                                         COMPLETEDACTIVE vcsa-8.0u2cvcsa8.0u2cdefaultVMware vCenter Server                                         COMPLETEDACTIVE vrops-8.16.1vrops8.16.1defaultVMware vRealize Operations                                    COMPLETEDACTIVE vrops-8.17.1vrops8.17.1defaultVMware vRealize Operations                                    COMPLETEDACTIVE zbox-12.4zbox12.4defaultzBox Utility VM with core services (DNS, DHCP, NTP, NFS, etc.)COMPLETEDACTIVE └─────────────────┴───────┴────────────┴─────────┴────────────────────────────────────────────────────────────────┴─────────────────┴────────┘

List components of a zPod

You will need to provide the zpod name parameter so that the CLI knows which zPod to list the components from.

❯ zcli zpod component list zpod_name

                                                        zPod Component List                                                         ┏━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┓ HostnameFQDN                           Component UID  NameVersion   Description                        Status ┡━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━╇━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━┩ esxi11https://esxi11.ovh.vcf.zpod.labesxi-8.0u2b-devesxi8.0u2b-devVMware ESXi Template               ACTIVE esxi12https://esxi12.ovh.vcf.zpod.labesxi-8.0u2b-devesxi8.0u2b-devVMware ESXi Template               ACTIVE esxi13https://esxi13.ovh.vcf.zpod.labesxi-8.0u2b-devesxi8.0u2b-devVMware ESXi Template               ACTIVE esxi14https://esxi14.ovh.vcf.zpod.labesxi-8.0u2b-devesxi8.0u2b-devVMware ESXi Template               ACTIVE vcfhttps://vcf.ovh.vcf.zpod.labvcf-5.1.1vcf5.1.1VMware Cloud Foundation            ACTIVE zboxhttps://zbox.ovh.vcf.zpod.labzbox-12.4zbox12.4zBox Utility VM with core services ACTIVE (DNS, DHCP, NTP, NFS, etc.)         └──────────┴─────────────────────────────────┴─────────────────┴──────┴────────────┴─────────────────────────────────────┴────────┘

Add components to a zPod

If you want to add a new component to a zpod, you will need to provide the component_uid. Component UID is a combination of a product name and a version, as many versions can exist for a given product. (use zcli component list to list available components)

❯ zcli zpod component add zpod_name -c component_uid

For example in our case:

❯ zcli zpod component add team.beta -c vcd-10.6.1

This will add the vcd-10.6.1 component to the team.beta zPod.

Manage DNS records

Since version 0.7.2, it is now possible to manage DNS records dynamically through the CLI to a zPod. This is useful when you want to add/update/remove a DNS record to a zPod that is not managed by the default zbox component.

This will require the new zbox-12.7 component to be part of the deployment profile.

List DNS records to a zPod

List DNS records to a zPod that is not managed by the default zbox component.

❯ zcli zpod dns list zpod_name

              zPod DNS List               ┏━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┓ IP          Hostname               ┡━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━┩ 127.0.0.1localhost 10.96.233.2zbox 10.96.233.2zbox.sddctest.zpod.lab 10.96.233.10vcsa 10.96.233.11esxi11 10.96.233.12esxi12 10.96.233.13esxi13 10.96.233.20nsx 10.96.233.31vrops8172 10.96.233.32vrops8171 10.96.233.33vrops8161 10.96.233.41vrli8161 10.96.233.51vcd106 └──────────────┴────────────────────────┘

Add DNS record to a zPod

Adding a DNS record to a zPod is useful when you want to add a DNS record to a zPod that is not managed by the default zbox component.

You can use 2 different ways to achieve this:

Using --host-id which allows you to set the host id on the management network of a zPod.

❯ zcli zpod dns add zpod_name --hostname samplename --host-id 11
in this case if your zpod management network was for example 192.168.10.0/26, the IP address of the DNS record will be 192.168.10.11

host-id is the host id on the management network of a zPod. This is explicitely used for profiles so we can easily set specific components configuration that will be deployed on the zpod management subnet and just have to make sure the host-id is set correctly/unique per profile.

Example base profile (esxi11 and esxi12 have host_id 11 and 12 respectively):

[
  {
    "component_uid": "zbox-12.7"
  },
  [
    {
      "component_uid": "esxi-8.0u3c",
      "host_id": 11,
      "hostname": "esxi11",
      "vcpu": 6,
      "vmem": 48
    },
    {
      "component_uid": "esxi-8.0u3c",
      "host_id": 12,
      "hostname": "esxi12",
      "vcpu": 6,
      "vmem": 48
    }
  ],
  {
    "component_uid": "vcsa-8.0u3d"
  }
]

This will result into the zpod deploying with podname as it's name and zpodfactory.domain set as the zpodfactory_default_domain with the following components in it:

  • 1 x zbox-12.7 component
  • 2 x esxi-8.0u3c components with host_id 11 and 12 respectively
  • 1 x vcsa-8.0u3d component

From a DNS perspective you will have the following DNS records:

zbox.podname.zpodfactory.domain -> 10.10.11.2
esxi11.podname.zpodfactory.domain -> 10.10.11.11
esxi12.podname.zpodfactory.domain -> 10.10.11.12
vcsa.podname.zpodfactory.domain -> 10.10.11.10

Using --ip which allows you to set any IP.

❯ zcli zpod dns add zpod_name --hostname samplename --ip 10.10.10.11

As you can imagine setting any ip, allows you to setup hostnames for any IP address, which can be useful for any use cases leveraging other network subnets (like any overlay network managed by NSX that might be routed within the zPod, etc)

Remove DNS record from a zPod

Remove a DNS record can be done using the below command line:

❯ zcli zpod dns remove zpod_name --hostname samplename --ip 10.10.10.11

Warning

You are responsible for any DNS record change, as deleting one of the core components WILL completely break the zPod.