# Platform9 PCD Upgrade Pre & Post Check Validation

## Problem

What are the Pre- and Post-Check Validations for Platform Self-Hosted PCD Upgrades?

## Environment

* Platform9 Private Cloud Director- Self-Hosted

## Upgrade Preparation

Refer to the following guidelines before starting any upgrades:

* [Platform9 Upgrades - Process and Impact](https://platform9.com/kb/platform9/platform9-upgrades-process-and-impact)
* [PCD Release Notes](https://platform9.com/docs/private-cloud-director/private-cloud-director/whats-new-in-pcd---releases---updates)

> In Release notes, ensure to go through the **Upgrade Notes**, **Bug Fixes** and **Know Issues**.

* [PCD Upgrade Documentation](https://platform9.com/docs/private-cloud-director/private-cloud-director/upgrade)

## Pre & Post-Check Validations

> Please continue to follow the same procedures both prior to and after the upgrade.> > SAVE all the outputs in a text file in the specified format **precheck-region**-**$(date)-versoin** and **postcheck-region-$(date)-version** > > It is essential to compare these outputs following the upgrade to ensure consistency and verify that the changes have been successfully implemented.

#### Control Plane Services Check:

1. Check the current PCD version and Status.

```bash
$ airctl status
```

The `airctl status` command should display a "**ready**" status for the **deployment status**, as well as for **region health**. Additionally, the **desired services** must match the **ready services** for all regions.

```bash
$ airctl status
fqdn:                test-pf9.platform9.com
region:              test-pf9
deployment status:   ready
region health:       ✅ Ready
version:              PCD 2025.6-151
-------- region service status ----------
desired services:     29
ready services:       29

------------- deployment details ---------------
fqdn:                test-pf9-regionone.platform9.com
region:              test-pf9-regionone
deployment status:   ready
region health:       ✅ Ready
version:              PCD 2025.6-151
-------- region service status ----------
desired services:     77
ready services:       77
```

* On checking `airctl status` If task state stuck in `**host_upgrade_error**`, use the following command to reset it

```bash
$ airctl reset-taskstate --region <AFFECTED_REGION_NAME> --region-state ready
```

2. Check the deployment status. All deployments should be available.

```bash
$ kubectl get deployment -n <REGION_NS>
```

3. Check the hostagent version.

```bash
$ NS=<WORKLOAD_REGION_NS>

$ kubectl -n $NS exec deploy_resmgr -c resmgr -- curl -s http:__localhost:8082_v1_hosts | jq -r '.[] | .host_id + " | " + .status + " | "+ .info.hostname + " | " + .host_agent.version'
```

Verify that the version of the **hostagent is consistent with the current version** of the management plane.

4. Check whether the hosts are responding or not from DB.

```bash
$ NS=<WORKLOAD_REGION_NS>

$ kubectl exec -i -n "$NS" $(kubectl get po -n "$NS" -l du-app=resmgr -o jsonpath="{.items[0].metadata.name}") -c resmgr -- mysql -t resmgr -u root -h $(kubectl get po -n "$NS" -l du-app=mysql -o jsonpath='{.items[0].status.podIP}') -p$(kubectl exec -i -n "$NS" $(kubectl get po -n "$NS" -l du-app=resmgr -o jsonpath="{.items[0].metadata.name}") -c resmgr -- _bin_bash -c "DB=\\$(consul-dump-yaml --start-key customers_\\$CUSTOMER_ID_regions_\\$REGION_ID_db | awk '_dbserver:_ {print \\$2}'); consul-dump-yaml --start-key customers_\\$CUSTOMER_ID_dbservers_\\$DB | awk '_admin_pass:_ {print \\$2}'") -e "SELECT id,hostname,responding FROM hosts;
```

A response of **0** indicates that the node is **not connected** to the management plane, while a response of **1** indicates that it **is connected** to the management plane.

> Disconnected hosts will not get upgraded. Please make sure that the hosts are connected to the management plane before starting host upgrade.

#### OpenStack Services Check:

> Export the **admin\_rc** file before executing the OpenStack Commands.

1. Check hypervisor list

```bash
$ openstack --insecure hypervisor list --long
```

2. Check hypervisor status

```bash
$ openstack --insecure hypervisor stats show
```

3. Check compute service list

```bash
$ openstack --insecure compute service list --long
```

4. Check network agent

```bash
$ openstack --insecure network agent list --long
```

5. Check volume service-list

```bash
$ openstack --insecure volume service list --long
```

6. Filter Inactive VM's

```bash
$ openstack server list --all | egrep -v "ACTIVE"
```

**UI Validation**

After the upgrade, attempt to access the UI and navigate through multiple pages to verify that the interface is functioning properly. Recommended sample pages include: hosts, cluster, VM, image, and network.

* If these steps prove insufficient or not applicable, reach out to the [Platform9 Support Team](https://support.platform9.com/hc/en-us) for additional assistance.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://platform9.com/kb/pcd/self-hosted/platform9-pcd-upgrade-pre-and-post-check-validation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
