# Discover, collect, and assess VMware VMs for migration

Learn how to download the Migration Center discovery client CLI and use it to remotely
discover, collect, and assess virtual machine (VM) instances running on VMware
for migration and containerization.

> [!NOTE]
> **Note:** The `mcdc` CLI can discover, collect, and assess up to 10,000 VMs in a single deployment.

You can generate offline assessment reports in a user-friendly HTML format.
These reports display the results for each of the migration targets and outlines
actions to take to eliminate blockers and risks.

## Before you begin

1. Provision a Linux machine to download and run the
   `mcdc` CLI. The Linux machine must have the
   following minimum requirements:

   - `glibc` version 2.25 or later
   - 4 GB RAM and 10 GB disk space
   - Network connectivity to vCenter and ESX hosts
2. Ensure that you have a vSphere user with the following permissions:

   - Read privileges to VMs
   - Read privileges to all the ESX hosts
   - Guest operation modifications
   - Guest operation program execution
   - Guest operation queries
3. Ensure that you have a user with administrator or root rights to all the
   target guest VMs.

## Download `mcdc` CLI

1. Connect to the Linux machine:

   ```bash
   ssh MACHINE_IP
   ```

   Replace <var translate="no">MACHINE_IP</var> with the IP address of your Linux machine.
2. Download the latest version of the `mcdc` CLI and make it
   executable:

   ```bash
   curl -O "https://mc-release.storage.googleapis.com/mcdc/$(curl -s https://mc-release.storage.googleapis.com/mcdc/latest)/mcdc"
   chmod +x mcdc
   ```

## Perform VMware inventory discovery

- Run the inventory discovery:

  ```bash
  ./mcdc discover vsphere -u USERNAME --url https://VSPHERE_URL
  ```

  Replace the following:
  - <var translate="no">USERNAME</var>: your vCenter username
  - <var translate="no">VSPHERE_URL</var>: the URL for your vCenter Server instance or the vSphere Client

  The output of the `discover` command looks like the following:

  ```
  [+] Found 13 VMs
  Collecting data...
  13 / 13 [---] 100.00% 5 p/s
  [✓] Collection completed.
  ```

## Perform guest discovery on all discovered VMs

- Run the guest discovery:

  ```
  ./mcdc discover vsphere guest all --url https://VSPHERE_URL \
    -u VCENTER_USER --vm-user VM_USER
  ```

  Replace the following:
  - <var translate="no">VCENTER_USER</var>: the vCenter server user
  - <var translate="no">VM_USER</var>: the VM user

  When prompted, enter the password for the <var translate="no">VCENTER_USER</var>
  and <var translate="no">VM_USER</var>.

## Generate reports to visualize the assessment

- Generate a summary report:

  ```bash
  ./mcdc report --format html > Summary_Report.html
  ```
- Generate a detailed report:

  ```bash
  ./mcdc report --format html --full > Detailed_Report.html
  ```

  HTML files named `Summary_Report.html` and `Detailed_Report.html` are
  created. Open the reports in a browser.

## Clean up

There are no charges associated with running the `mcdc` CLI.
However, you can delete the collected data from the local database.

- Delete the `mcdc` CLI data:

  ```bash
  ./mcdc discover purge-db -db DATABASE_NAME
  ```

  Replace <var translate="no">DATABASE_NAME</var> with the path to the database where the
  collected data is stored. Typically, it is in the same directory where you
  downloaded the `mcdc` CLI.

## What's next

- Learn how to [migrate a Linux VM](https://docs.cloud.google.com/migrate/containers/docs/migrate-vm.md.txt).
- Learn more about the [`mcdc` CLI](https://docs.cloud.google.com/migration-center/docs/discovery-client-cli-overview.md.txt).