We are going to migrate one of our classical environments which doesn't have NSX to a new env. which has NSX.
To start doing some analysis, we will need to collect these data :
We are going to migrate one of our classical environments which doesn't have NSX to a new env. which has NSX.
To start doing some analysis, we will need to collect these data :
We are going today to do a backup for the vDS of the vCenter and backup the DRS rules and groups
1. The first step is to encrypt your administrator@vsphere.local password, you will find the script on the Github How to encrypt the password
2. The second step is to use your encrypted password in this script How to backup vDS and DRS rules
3. Schedule this script in the task scheduler of your jump box.
Note: I highly recommend to use a service account to execute the backup scripts.
We will explain here how you can reapply the vSphere Tags after you migrate a VM from one vCenter to another or even when you use VEEAM or any other replication tool to replicate a VM from one vCenter to another vCenter
Before executing this script you will need to create 2 folders in the 2 vCenters with the same name. and put the machines under these folders. because the main Idea of the script is getting the VMs under a certain folder and collect their TAGs , and then login to the other vCenter and search for the collected VMs and start to apply the TAGs on them. you also will need to make sure that the TAGs exist on the destination VC (The script will not create the TAGs , it will apply them only)
Import-Module VMware.VimAutomation.Core
$vCenterIP = "First vCenter"
$FOLDERNAME = 'XXXX' ##Change XXXX with folder Namer###
Connect-VIServer $vCenterIP
$tagsall = @()
foreach($machine in $machines = Get-Folder -Name $FOLDERNAME | Get-VM){
$tagsall+=@(Get-TagAssignment -Entity $machine.name)
}
$tagsall
sleep 10
Disconnect-VIServer $vCenterIP -confirm:$false
1. Don't close your Powershell window.
2. Start to do the cross vCenter vmotion.
3. After you finish from all the VMs.
4. Execute the below script.
$vCenterIP = "Second vCenter"
Connect-VIServer $vCenterIP -User $vCenterUser -Password $vCenterPass
$tagsallnew = $tagsall | select Tag,Entity
for($i = 0; $i -lt $tagsallnew.length; $i++){
$tag = Get-Tag -name $tagsallnew[$i].tag.name -Category $tagsallnew[$i].tag.Category.name -Server "Second vCenter"
$vm = get-vm -name $tagsallnew[$i].Entity.Name -Server "Second vCenter"
New-TagAssignment -Tag $tag -Entity $vm -Server "Second vCenter"
}
We will explain how to log in with a local account to your NSX-T which integrated with VIDM. We integrated our NSX-T into the VIDM. We had a...