You can change the domain of an existing Operations Manager installation.
To change the domain of an existing Operations Manager installation:
Go to the Tanzu Operations Manager Installation Dashboard.
Click the VMware Tanzu Application Service for VMs (TAS for VMs) tile.
Select Domains to see the current Apps domain for your TAS for VMs deployment.
In the terminal, run:
cf login -a API-ENDPOINT
Where API-ENDPOINT
is the API endpoint for your TAS for VMs instance.
The cf CLI prompts you for your Operations Manager username and password, and the org and space you want to access. If you do not know your API endpoint, see Identifying the API Endpoint for Your TAS for VMs Instance.
To view the domains in the space, run:
cf domains
The command returns output similar to the following example:
$ cf domains Getting domains in your-org as admin... name status yourapps.yourdomain.com shared
If you have more than one shared domain, ensure that the domain you want to change is at the top of the list before you apply the new domain to your TAS for VMs tile configuration. You can delete and recreate the other shared domains as necessary to push the domain you want to change to the top of the list. If you do this, make sure to map the routes again for each domain.
The status column is named availability. The table refers to private domains with private instead of own. For more information, see Configuring Routes and Domains.
To confirm that your apps are assigned to the domain you plan to change, run:
cf routes
The command returns output similar to the following example:
$ cf routes Getting routes as admin ... space host domain apps your-space yourapp yourapps.yourdomain.com yourapp
To create the new domain you want to use, run:
cf create-shared-domain NEW-DOMAIN
Where NEW-DOMAIN
is the name you give the new domain.
The command returns output similar to the following example:
$ cf create-shared-domain newapps.yourdomain.com Creating shared domain newapps.yourdomain.com as admin... OK
To map the new domain to your app, run:
cf map-route APP-NAME NEW-DOMAIN -n HOST-NAME
Where:
APP-NAME
is the name of the app you want to map to the new domain.NEW-DOMAIN
is the domain to which you want to map your app.HOST-NAME
is the hostname of the URL for the route you are mapping.When you map a TCP route to an app, a random port is assigned to the route by default. To specify a port for a TCP route, use the –port flag.
The command returns output similar to the following example:
$ cf map-route yourapp newapps.yourdomain.com -n yourapp Creating route yourapp.newapps.yourdomain.com for org your-org / space your-space as admin... OK Adding route yourapp.newapps.yourdomain.com to app yourapp in org your-org / space your-space as admin... OK
In this example, both the APP-NAME
and HOST-NAME
arguments are yourapp
, because this is both the name of the app to which you are mapping a route and the intended hostname for the URL.
Repeat the previous step for each app in this space. Then check Apps Manager to confirm that the route URL has updated correctly for each app.
Repeat the previous steps for each space in your Operations Manager installation except for the System org, beginning with logging into the org and space and ending with confirming the URL update.
Ordinarily the System org contains only Operations Manager apps that perform utility functions for your installation. VMware does not recommend pushing apps to this org. However, if you have pushed apps to the System org, you must also repeat the previous steps for these apps.
Once you confirm that every app in every space has been mapped to the new domain, delete the old domain by running:
cf delete-shared-domain OLD-DOMAIN
Where OLD-DOMAIN
is the old domain to delete.
The command returns output similar to the following example:
$ cf delete-shared-domain yourapps.yourdomain.com Deleting domain yourapps.yourdomain.com as admin... This domain is shared across all orgs. Deleting it removes all associated routes, and makes any app with this domain unreachable. Are you sure you want to delete the domain yourapps.yourdomain.com?
When you are prompted, type yes
to confirm that you want to delete the domain.
In the Domains pane of the TAS for VMs tile, enter the new domain in the Apps domain field. This configures TAS for VMs to use the new domain.
Return to the Tanzu Operations Manager Installation Dashboard.
Click Review Pending Changes.
Click Apply Changes. Any apps you push after this update finishes use this new domain.