Changing the URL or IP address of a registered NFS datastore
search cancel

Changing the URL or IP address of a registered NFS datastore

book

Article ID: 343053

calendar_today

Updated On:

Products

VMware

Issue/Introduction

Symptoms:
  • The IP address or URL of an existing NFS datastore needs to be changed due to changes in the network
  • When the database is re-added, a duplicate may appear if the same name is used to refer the previously connected datastore
  • After removing and re-adding an NFS datastore with a new URL or IP address, a duplicate entry appears in the web interface with (1) appended to the name.


Environment

VMware vCenter Stage Manager 1.0.x
VMware vCenter Lab Manager 4.0.x
VMware vCenter Lab Manager 3.0.x

Resolution

Lab Manager and Stage Manager do not provide an interface option to update the URL to an NFS datastore in an existing record entry. However, if the datastore is removed and re-added with a different URL or IP address using the same name, a duplicate entry appears in the Web interface.
To resolve this issue and to avoid a duplicate entry, update the record in the datastores table of the Lab Manager database with the new URL or IP address before re-adding the NFS datastore.
Note: This procedure may not complete cleanly if there are any Lab Manager virtual machines with saved states or unconsolidated linked clones. Ensure that all virtual machines do not have saved states, or unconsolidated linked clones before performing this procedure.
To update the record in the datastores table:
  1. Remove the NFS datastore entry from vCenter Server.
  2. Log in to the Lab Manager server as an administrator.
  3. Open a command prompt. For more information, see Opening a command or shell prompt (1003892).
  4. Open a connection to the database.
  5. Run this command:

    osql –S localhost\VLM –E –d LabManager

    Note: When using Stage Manager, substitute VLM and LabManager variables in these examples with VSM and StageManager. When using Lab Manager 4.x or later, substitute the VLM variable in these examples with LabManager.


  6. Run this query to identify the datastore_id of the NFS connection to be updated:

    select datastore_id, url, mount_host from datastore
    go

    You see an output similar to:

    1
    sanfs://vmfs_uuid:47942be1-97e5152c-59b7-003ac461c23e/
    NULL
    3
    netfs://192.168.1.50//share/LabManager/
    192.168.1.50
    4
    netfs://192.168.1.20//vol/vol0/home/ISO/
    host.domain.com

    (3 rows affected)


  7. Find the NFS datastore entry that needs to be updated and note the datastore_id (the first numeric value).

  8. Run these SQL statements to update the record in the table to the new URL or IP address:

    update datastore set url = 'netfs://192.168.1.55//share/LabManager/' where datastore_id = ID
    update datastore set mount_host = '192.168.1.55' where datastore_id = ID
    go

    Where ID is the ID noted in Step 7.

    For example, the following SQL statements update datastore_id 3 from the sample output in Step 6 to a new IP address:

    update datastore set url = 'netfs://192.168.1.55//share/LabManager/' where datastore_id = 3
    update datastore set mount_host = '192.168.1.55' where datastore_id = 3
    go

    Note: Ensure that you do not miss the trailing / after LabManager in the first update statement.

  9. Exit OSQL and the command prompt.
  10. Re-add the NFS datastore to vCenter Server.