Skip to main content

Preparing the VMware Environment

Before creating a source in the panel, you need to prepare your VMware environment for installing the Agent. To do this, you provide the Agent's network access, create a user in vCenter with the minimum access the Agent needs, and create an access key in Arvancloud specifically for Cloud Migration.

Before you start, make sure you have the following:

  • A licensed vCenter or ESXi with one of the supported versions
  • The access needed to deploy an OVA file and create a virtual machine in the vSphere management network
  • vCenter admin access to create a user and role
  • A network with internet access for the Agent to communicate with the Arvancloud APIs

Network Requirements​

The Agent needs two network paths to work. The first is access to the Arvancloud APIs: the Agent must be able to send requests to the napi.arvancloud.ir domain and the Arvancloud Object Storage endpoint. The second is access to the VMware management network: the Agent must be able to reach both vCenter and all the ESXi hosts that your virtual machines are on.

The Agent first connects to vCenter and then connects directly to ESXi to transfer data. So if one of the ESXi hosts isn't reachable by the Agent in the management network, migration of that ESXi's virtual machines fails.

Access to the Arvancloud APIs​

The Agent can be behind NAT and doesn't need a public IP to access the internet. The Agent doesn't expose any port or service and initiates the connection to Arvancloud itself; even so, don't assign a public IP to the Agent machine.

Access to the Management Network​

vCenter is usually in a private management range, such as 192.168.0.0/24, that has no route to the internet. The Agent must be present directly at layer 2 in the same network and get an IP from its range. Proxying a port or a domain isn't enough for this connection and causes the migration to fail.

For example, if your management network addresses look like this:

vcenter-01 -> 192.168.101.111/24
esxi-01 -> 192.168.101.15/24
esxi-02 -> 192.168.101.16/24

The Agent must also have an IP from the same range:

agent-01 -> 192.168.101.222/24

Agent Network Cards​

The Agent has two network cards, and during installation you connect each to one of the vSphere networks. Before installing, select or create these two networks (port groups) in vSphere:

  • Management network

    The network that vCenter and the ESXi hosts are in. This network doesn't need a gateway.

  • Internet network

    A network with internet access, preferably behind NAT and with a gateway IP.

If your management network also has internet access, both needs are met by that network. In this case, the Agent still needs two network cards, but you can connect both to the same network.

For example, suppose your vCenter has the following three networks:

  • PG_LAN, a NAT network with the range 192.168.123.0/24 that has internet access through a router
  • PG_PUBLIC, a public IP range for assigning public IPs directly to machines
  • PG_WAN, the protected management network that vCenter is in

In this case, connect the Agent's management network card to PG_WAN and its internet network card to PG_LAN. Don't use PG_PUBLIC, because it exposes the Agent to the internet with a public IP.

Creating a vCenter User for the Agent​

The Agent needs a vCenter user to list virtual machines, read their details, and take snapshots. You can also use vCenter's root or admin user, but to follow the principle of least privilege, create a separate user and give it only the following privileges:

Privilege IDPath in vSphere Client
VirtualMachine.State.CreateSnapshotVirtual machine → Snapshot management → Create snapshot
VirtualMachine.State.RemoveSnapshotVirtual machine → Snapshot management → Remove snapshot
VirtualMachine.Config.ChangeTrackingVirtual machine → Change Configuration → Toggle disk change tracking
VirtualMachine.Config.AdvancedConfigVirtual machine → Change Configuration → Advanced configuration
VirtualMachine.Config.DiskLeaseVirtual machine → Change Configuration → Acquire disk lease
VirtualMachine.Provisioning.DiskRandomReadVirtual machine → Provisioning → Allow read-only disk access
VirtualMachine.Provisioning.GetVmFilesVirtual machine → Provisioning → Allow virtual machine download
Datastore.AllocateSpaceDatastore → Allocate space
Datastore.BrowseDatastore → Browse datastore

Step 1: Create the User​

In vSphere Client, go to Administration and, under Single Sign On, select Users and Groups. In the Users tab, set the domain to vsphere.local and add a new user named rvdr-agent.

Choose a strong password for this user, including lowercase and uppercase English letters, numbers, and special characters, and keep it somewhere safe. You need this password when setting up the Agent.

Step 2: Create the Role​

From Administration, go to Access Control and then Roles, and click NEW.

Create a role named RVDR Backup Agent, give it the 9 privileges in the table above, and save the changes.

Step 3: Assign the Role to the User​

Go to Hosts and Clusters, select the root of the cluster, and click Add in the Permissions tab.

In the window that opens, select the vsphere.local domain and the rvdr-agent user, set the role to RVDR Backup Agent, and enable Propagate to children. Then save the permission.

Note that if you don't enable Propagate to children, the permissions aren't passed down to the virtual machines and datastores underneath, and the Agent can't take snapshots of them.

If you use a standalone ESXi instead of vCenter, give the same privileges to a local user on that ESXi through the ESXi Host Client.

Creating an Arvancloud Access Key for the Agent​

The Agent connects to Arvancloud with an API key. Create this key for a separate machine user and give it only the Migration Zone Management role, so its access stays limited to Cloud Migration.

Step 1: Create a Machine User and API Key​

In the panel, select Settings from the main menu, and in the IAM section click Machine User List. Create a new machine user and create an API key for it. The Machine User guide helps you with this.

Copy the API key, which starts with apikey, and keep it somewhere safe.

Note that the API key is shown only once, and after you close the window, you can no longer access it.

Step 2: Define an Access Policy​

In the IAM section, select Resource and Access Management, and in the Create Access Policy column, click the + icon next to the workspace.

In the window that opens, select the machine user you created, leave the members section empty, and click Continue. In the Choose a Role for Members step, select the Migration Zone Management role, and after entering a name and description, confirm the access policy.

After preparing the environment, you can create the source and set up the Agent.