Issue:
NSX Tags are not retained following a powered-off VM vMotion from one DC to another DC in an NSX Federation environment.
NSX Tags are replicated successfully from one LM to another LM upon live-vMotion, however, if the VM needs to be powered off prior to migration, additional configuration is needed. See cause and resolution sections.
NSX 3.x, 4.x
NSX Federation
A tag replication policy needs to be configured in order for NSX tags to be replicated from LM to LM during a powered-off vmotion of the VM.
Per Working with NSX Federation documentation, you need to configure VM Tag Replication across LMs using GM API:
*Please note that while the documentation specifically mentions SRM, it is not needed for this to function.
Example config:
PUT https://{{gm}}/global-manager/api/v1/global-infra/vm-tag-replication-policies/policy1{ "display_name":"vm tag replication policy Paris to London", "description":"vm tag replication policy1", "protected_site": "/global-infra/sites/LM_Paris", "replication_type": "STORAGE_ARRAY_REPLICATION", "tag_delay_delete_time": 30, "recovery_sites": [ "/global-infra/sites/LM_London" ], "groups":[ "/global-infra/domains/default/groups/Web-VM-Group", "/global-infra/domains/default/groups/DB-VM-Group" ], "vm_match_criteria": "MATCH_BIOS_UUID_NAME"PUT https://{{gm}}/global-manager/api/v1/global-infra/vm-tag-replication-policies/policy1{ "display_name":"vm tag replication policy Paris to London", "description":"vm tag replication policy1", "protected_site": "/global-infra/sites/LM_Paris", "recovery_sites": [ "/global-infra/sites/LM_London" ], "groups":[ "/global-infra/domains/default/groups/Web-VM-Group", "/global-infra/domains/default/groups/DB-VM-Group" ], "vm_match_criteria": "MATCH_BIOS_UUID_NAME"
Explanation of Tag replication:
Given the above example: