AWS Linux ZCA Migration NIC Reassignment Script
- Last UpdatedDec 03, 2024
The NIC Reassignment script is used to switch the Network Interface Card (NIC) from the Windows ZCA VM to the Linux ZCA within an AWS environment. Once the script is completed, the Linux ZCA is recreated with the original Windows ZCA VM IP address and the Windows ZCA VM is recreated with the Linux ZCA IP address.
The process of the NIC reassignment includes:
-
Stop ZCA instances
-
Take AMI backup of both instances
-
Terminate the instances
-
Launch new Linux ZCA instance and recreate all details including tags, volumes, encryption and KMS ID
-
Delete duplicate nodes
-
Restore properties on the Linux ZCA
Within this process, both instances of Windows and Linux ZCA VMs are terminated before swapping IPs. All instance IDs are changed following the reassign script, so make sure to back up all configuration on the Windows ZCA.
Executing the Script
-
Download the script via the
wget https://raw.githubusercontent.com/ZertoPublic/AWS/main/migration_utility_scripts/reassign-nic.bash
command. -
In AWS click Cloud Shell.
-
In Actions, select Upload File.
-
Select the reassign-nic.bash file
-
Run the following command to enable script execution permissions:
chmod +x reassign-nic.bash
-
To execute the script run the following command:
./reassign-nic.bash --windows-zca-ip <Windows_ZCA_IP> --linux-zca-ip <Linux_ZCA_IP>
-
Proceed to the migration phase, see AWS Linux ZCA Migration Wizard. Once the migration is completed, you must manually delete the AMIs and the machine snapshots from the backup, that were connected to the deleted Windows ZCA .
Reassign Failure
If reassign failed after terminating the instances, execute the script again with the recreate command:
./reassign-nic.bash --windows-zca-ip <Windows_ZCA_IP> --linux-zca-ip
<Linux_ZCA_IP>
--recreate <recreation-params file path>
Example: ./reassign-nic.bash --windows-zca-ip 127.10.10.10 --linux-zca-ip 127.10.10.11 --recreate recreation-params-20240415164057.txt
If one or both instances are already created they should not be terminated, else the script will fail.
Revert Reassign
To revert all changes run the following command:
./reassign-nic.bash --windows-zca-ip
<new_Windows_ZCA_IP>
--linux-zca-ip <new_Linux_ZCA_IP>
In this command, the reassigned IP values are switched back to their original IPs. Once completed both VMs retain the original VM IP addresses but the instance IDs are changed.
It can be run only when the original run ends successfully.
Troubleshooting
Check the script logs in the script location for any issues that may have occurred in the reassign process.