<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>migration &#8211; Blog of Kliment Andreev &#8211; A place so I won&#039;t forget things</title>
	<atom:link href="https://blog.andreev.it/tag/migration/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.andreev.it</link>
	<description></description>
	<lastBuildDate>Sat, 24 Oct 2020 13:31:05 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>PowerShell, Azure: Migrate a Windows VM from vCenter to Azure</title>
		<link>https://blog.andreev.it/2017/10/114-azure-migrate-vm-vcenter-azure/</link>
					<comments>https://blog.andreev.it/2017/10/114-azure-migrate-vm-vcenter-azure/#respond</comments>
		
		<dc:creator><![CDATA[Kliment Andreev]]></dc:creator>
		<pubDate>Wed, 04 Oct 2017 12:22:54 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[Cloud]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[migration]]></category>
		<guid isPermaLink="false">http://blog.iandreev.com/?p=3246</guid>

					<description><![CDATA[Recently, I had to migrate a VM from vCenter to Azure. Unlike the migration&#8230;]]></description>
										<content:encoded><![CDATA[<div id="bsf_rt_marker"></div><p>Recently, I had to migrate a VM from vCenter to Azure. Unlike the migration from vCenter to AWS, this migration is a little bit trickier and involves many steps. There is probably a better way with Azure Site Recovery, but you have to pay for that. See my other <a href="https://blog.andreev.it/?p=5617" rel="noopener noreferrer" target="_blank">post </a>for that.<br />
We&#8217;ll use PowerShell for the migration. There are several prerequisites for the migration and they are listed in the comments section.<br />
I have a resource group called <strong>rgTest</strong>, a virtual network called <strong>vnetTest </strong>and a subnet that spans all of the virtual network address space called <strong>subTest</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/10/P092-01.png"><img fetchpriority="high" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/10/P092-01.png" alt="" width="316" height="626" class="aligncenter size-full wp-image-7755" srcset="https://blog.andreev.it/wp-content/uploads/2017/10/P092-01.png 316w, https://blog.andreev.it/wp-content/uploads/2017/10/P092-01-151x300.png 151w" sizes="(max-width: 316px) 100vw, 316px" /></a><br />
In addition, I&#8217;ve created a storage account called <strong>sablogtest </strong>and a container called <strong>conttest</strong>.</p>
<p><a href="https://blog.andreev.it/wp-content/uploads/2017/10/P092-02.png"><img decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/10/P092-02.png" alt="" width="999" height="711" class="aligncenter size-full wp-image-7756" srcset="https://blog.andreev.it/wp-content/uploads/2017/10/P092-02.png 999w, https://blog.andreev.it/wp-content/uploads/2017/10/P092-02-300x214.png 300w, https://blog.andreev.it/wp-content/uploads/2017/10/P092-02-768x547.png 768w, https://blog.andreev.it/wp-content/uploads/2017/10/P092-02-585x416.png 585w" sizes="(max-width: 999px) 100vw, 999px" /></a><br />
On my local machine, I have the VMDK files downloaded from vCenter in a folder called <strong>VM </strong>and I have another folder called <strong>VHD </strong>where the converted files will be stored. For the script, use the names of the VMDK files that are 1K in size.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/10/P092-03.png"><img decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/10/P092-03.png" alt="" width="689" height="411" class="aligncenter size-full wp-image-7757" srcset="https://blog.andreev.it/wp-content/uploads/2017/10/P092-03.png 689w, https://blog.andreev.it/wp-content/uploads/2017/10/P092-03-300x179.png 300w, https://blog.andreev.it/wp-content/uploads/2017/10/P092-03-585x349.png 585w" sizes="(max-width: 689px) 100vw, 689px" /></a></p>
<p>The script works if the OS has one or two drives. If you have more drives, you&#8217;ll have to modify the script. It should be very straightforward.<br />
I&#8217;ve noticed that if I run the script in PowerShell cmd, then the script waits sometimes for the user to hit any key. In Windows ISE PowerShell, I didn&#8217;t have these problems. Make sure you are local admin on the machine. It&#8217;s needed because of the VMDK to VHD conversion.<br />
The VM will power up automatically. When you RDP to it, the data drive won&#8217;t be accessible. Make sure you run <strong>diskmgmt.msc</strong> and then online the drive. </p>
<pre class="brush: powershell; collapse: true; light: false; title: ; toolbar: true; notranslate">
################################################################################
## Kliment Andreev 2017 - (c) BSD License
################################################################################
## 1. Converts VMDK file(s) to VHD
## 2. Uploads the VHD(s) to an existing container
## 3. Creates a bootable disk and/or data disk
## 4. Creates a VM with a public and private IP
################################################################################
# Pre-req:
#       Microsoft CLI 2.0 for Azure
#       Microsoft Virtual Machine Converter 3.0
#       VMDK file(s) and enough storage to convert it/them to VHD
#       Existing subscription in azure
#       Known location of your subscription e.g East US
#       Existing resource group
#       Existing storage account and a container inside
#       Existing vNet where server will reside
#       Existing subnet where the server will reside
#       Existing security group that allows RDP
#       Make sure the OS is set for DHCP
#       Make sure the OS uses E1000, don't use vmxnet NIC
#       Make sure you know your local admin password
#       Make sure you have RDP enabled
################################################################################
# If for some reason the script fails 
# and you are starting from scratch,
# make sure you delete the VHD files.
# Otherwise the converter will create a new
# VHD file with (1) as suffix and the VM
# won't convert/upload properly
################################################################################
# Define your resources/variables here
# None of these can be empty except:
# $myDataVMDKFile and $myDataVHDFile
################################################################################
# Define where is your OS VMWare VMDK file, e.g. c:\users\name\desktop\server.vmdk
$myOSVMDKFile = &quot;C:\Users\klimenta\Desktop\VM\testvm.vmdk&quot;
# Define where is your DATA VMWare VMDK file, e.g. c:\users\name\desktop\server.vmdk
# If you have only C: drive, the string below can be empty e.g. &quot;&quot;
$myDataVMDKFile = &quot;C:\users\klimenta\desktop\VM\testvm_1.vmdk&quot;  
#$myDataVMDKFile = &quot;&quot; 
# Where do you want your OS VHD file created locally, e.g. c:\users\name\desktop\server.vhd
$myOSVHDFile = &quot;C:\Users\klimenta\Desktop\VHD\testvm.vhd&quot;   
# Where do you want your Data VHD file created locally, e.g. c:\users\name\desktop\server.vhd
$myDataVHDFile = &quot;C:\Users\klimenta\Desktop\VHD\testvm_1.vhd&quot;   
#$myDataVHDFile=&quot;&quot;
# Virtual Machine Converter PS module
$ConverterFile = &quot;C:\Program Files\Microsoft Virtual Machine Converter\MvmcCmdlet.psd1&quot;
# Existing subscription name
$mySubscription = &quot;Pay-As-You-Go&quot;
# Existing location
$myLocation = &quot;East US&quot;
# Existing resource group
$myResourceGroup = &quot;rgTest&quot;
# Name of the existing storage account (it shoould be unique)
$myStorageAcct = &quot;sablogtest&quot;
# Name of the existing container
$myContainer =&quot;conttest&quot;
# Name of the existing VNET
$myVNET = &quot;vnettest&quot;
# Name of the existing subnet
$mySubnet = &quot;subtest&quot;
# Name of the existing security group
$mySecurityGroup = &quot;sgAllowRDP&quot;
# VM size
$myVMSize = &quot;Standard_A2&quot;
################################################################################
# If Standard_A2
# doesn't suit your needs
# check other sizes in a region with:
# Get-AzureRmVMSize -Location &quot;East US&quot; | Sort-Object Name
################################################################################
# Start the counter
################################################################################
$StartDate = (Get-Date)
# Check if any of the variables are blank
if (!(($myOSVMDKFile) -and ($myOSVHDFile) -and ($ConverterFile) -and ($mySubscription) -and `
    ($myLocation) -and ($myResourceGroup) -and ($myStorageAcct) -and ($myContainer) -and ($myVNET) -and `
    ($mySubnet) -and ($mySecurityGroup) -and ($myVMSize))) {
    Write-Host &quot;Some of the required variables are empty. Exiting...&quot; -ForegroundCOlor Red
    Exit
}
# Check if the OS VMDK exists
if (-not(Test-Path -Path $myOSVMDKFile)) {
        Write-Host &quot;Error: VMDK file does not exist. Exiting...&quot; -ForegroundColor Red
        Exit
}
# Check if the Data VMDK exists but only if defined
if ($myDataVMDKFile -ne &quot;&quot;)
{
    if (-not(Test-Path -Path $myDataVMDKFile)) {
            Write-Host &quot;Error: VMDK file does not exist. Exiting...&quot; -ForegroundColor Red
            Exit
    }
}
################################################################################
# Check the VHD
################################################################################
$extension = (&#x5B;IO.Path]::GetExtension($myOSVHDFile)).ToUpper()
if ($extension -ne &quot;.VHD&quot;) {
    Write-Host &quot;Error: Not a VHD file. Exiting...&quot; -ForegroundColor Red
    Exit
}
################################################################################
# Import Virtual Machine Converter
################################################################################
if (-not(Test-Path -Path $ConverterFile)) {
        Write-Host &quot;Error: Microsoft Virtual Machine Converter not installed. Exiting...&quot; -ForegroundColor Red
        Exit
}
Import-Module $ConverterFile
# Get the VHD file name only and the URL of the container
$VHDOSFileName = &#x5B;io.path]::GetFileName($myOSVHDFile)
$VHDDataFileName = &#x5B;io.path]::GetFileName($myDataVHDFile)
$urlOS = &quot;https://&quot; + $myStorageAcct + &quot;.blob.core.windows.net/&quot; + $myContainer + &quot;/&quot; + $VHDOSFileName
$urlData = &quot;https://&quot; + $myStorageAcct + &quot;.blob.core.windows.net/&quot; + $myContainer + &quot;/&quot; + $VHDDataFileName
################################################################################
# Log in to your Azure account
################################################################################
Write-Host &quot;Waiting...Login prompt coming up...&quot; -ForegroundColor Yellow
try {
    Login-AzureRmAccount
}
catch {
    Write-Host $_.Exception.Message -ForegroundColor Red
    Exit
}
################################################################################
# Check if you can log to the specified subscription
################################################################################
try {
    if(Get-AzureRmSubscription -SubscriptionName $mySubscription -ErrorAction Stop) {}
}
catch {
    Write-Host $_.Exception.Message -ForegroundColor Red
    Write-Host &quot;Error: The name of the subscription is incorrect or you don't have rights. Exiting...&quot; -ForegroundColor Red
    Exit
}
Get-AzureRmSubscription -SubscriptionName $mySubscription | Select-AzureRmSubscription
Write-Host &quot;Your current subscription is set to&quot; $mySubscription -ForegroundColor Yellow
################################################################################
# Check if the resource group exists
################################################################################
try {
    if(Get-AzureRmResourceGroup -ResourceGroupName $myResourceGroup -ErrorAction Stop) {}
}
catch {
    Write-Host $_.Exception.Message -ForegroundColor Red
    Write-Host &quot;Error: The name of the resource group is incorrect or you don't have rights. Exiting...&quot; -ForegroundColor Red
    Exit
}
################################################################################ 
# Converting from VMDK to VHD (OS)
# If you get an error from Azure that the blob is corrupted, use 
# -VhdType FixedHardDisk
################################################################################
try {
    Write-Host &quot;Converting VMDK OS Disk to VHD in progress... Hit any key when no progress on top.&quot; -ForegroundColor Yellow
    if(ConvertTo-MvmcVirtualHardDisk -SourceLiteralPath $myOSVMDKFile -DestinationLiteralPath $myOSVHDFile `
    -VhdType DynamicHardDisk -VhdFormat Vhd -ErrorAction Stop) {}
}
catch {
    Write-Host $_.Exception.Message -ForegroundColor Red
    Write-Host &quot;Error: The VMDK file is most likely corrupt, access violation or incorrect VMDK format. Exiting...&quot; -ForegroundColor Red
    Exit
}
################################################################################
# Converting from VMDK to VHD (Data)
# If you get an error from Azure that the blob is corrupted, use 
# -VhdType FixedHardDisk
################################################################################
if ($myDataVMDKFile -ne &quot;&quot;)
{
    try {
        Write-Host &quot;Converting VMDK Data Disk to VHD in progress... Hit any key when no progress on top.&quot; -ForegroundColor Yellow
        if(ConvertTo-MvmcVirtualHardDisk -SourceLiteralPath $myDataVMDKFile -DestinationLiteralPath $myDataVHDFile `
        -VhdType DynamicHardDisk -VhdFormat Vhd -ErrorAction Stop) {}
    }
    catch {
        Write-Host $_.Exception.Message -ForegroundColor Red
        Write-Host &quot;Error: The VMDK file is most likely corrupt, access violation or incorrect VMDK format. Exiting...&quot; -ForegroundColor Red
        Exit
    }   
}   
################################################################################
# Upload the OS VHD to the existing blob/container
################################################################################
Write-Host &quot;Uploading OS VHD to&quot; $urlOS -Foreground Yellow
Add-AzureRmVhd -ResourceGroupName $myResourceGroup -Destination $urlOS -LocalFilePath $myOSVHDFile -OverWrite
# Upload the Data VHD to the existing blob/container
if ($myDataVMDKFile -ne &quot;&quot;)
{
    Write-Host &quot;Uploading Data VHD to&quot; $urlData -Foreground Yellow
    Add-AzureRmVhd -ResourceGroupName $myResourceGroup -Destination $urlData -LocalFilePath $myDataVHDFile -OverWrite
}
################################################################################
# Create the OS disk
################################################################################
Write-Host &quot;Creating OS disk from VHD...&quot; -Foreground Yellow
$VHDOSFileNameOnly = &#x5B;io.path]::GetFileNameWithoutExtension($VHDOSFileName)
try {
    $osDisk = New-AzureRmDisk -DiskName $VHDOSFileName -Disk `
        (New-AzureRmDiskConfig -AccountType StandardLRS  -Location $myLocation -CreateOption Import `
        -SourceUri $urlOS) `
        -ResourceGroupName $myResourceGroup
}
catch {
    Write-Host $_.Exception.Message -ForegroundColor Red
    Write-Host &quot;Error: Something went wrong when creating the OS disk. Exiting...&quot; -ForegroundColor Red
    Exit
}
################################################################################
# Create the Data disk
################################################################################
if ($myDataVMDKFile -ne &quot;&quot;)
{
    Write-Host &quot;Creating data disk from VHD...&quot; -Foreground Yellow
    $VHDDataFileNameOnly = &#x5B;io.path]::GetFileNameWithoutExtension($VHDDataFileName)
    try {
        $dataDisk = New-AzureRmDisk -DiskName $VHDDataFileName -Disk `
            (New-AzureRmDiskConfig -AccountType StandardLRS  -Location $myLocation -CreateOption Import `
            -SourceUri $urlData) `
            -ResourceGroupName $myResourceGroup
    }
    catch {
        Write-Host $_.Exception.Message -ForegroundColor Red
        Write-Host &quot;Error: Something went wrong when creating the data disk. Exiting...&quot; -ForegroundColor Red
        Exit
    }
}
################################################################################
# Create and assign a public IP
################################################################################
$ipName = &quot;ip&quot; + $VHDOSFileNameOnly
Write-Host &quot;Creating and assigning a public IP&quot; $ipName -Foreground Yellow
try {
    $pip = New-AzureRmPublicIpAddress -Name $ipName -ResourceGroupName $myResourceGroup -Location $myLocation `
        -AllocationMethod Dynamic
}
catch {
    Write-Host $_.Exception.Message -ForegroundColor Red
    Write-Host &quot;Error: Something went wrong with the IP. Exiting...&quot; -ForegroundColor Red
    Exit
}
################################################################################
# Create the NIC
################################################################################ 
$nicName = &quot;nic&quot; + $VHDOSFileNameOnly
Write-Host &quot;Creating the NIC&quot; $nicName -Foreground Yellow
try {
    $VNET = Get-AzureRmVirtualNetwork -Name $myVNET -ResourceGroupName $myResourceGroup -ErrorAction Stop
}
catch {
    Write-Host $_.Exception.Message -ForegroundColor Red
    Write-Host &quot;Error: Something went wrong with the NIC. Check the vNet name. Exiting...&quot; -ForegroundColor Red
    Exit
}
try {
    $nic = New-AzureRmNetworkInterface -Name $nicName -ResourceGroupName $myResourceGroup `
        -Location $myLocation -SubnetId $VNET.Subnets&#x5B;0].Id -PublicIpAddressId $pip.Id -NetworkSecurityGroupId $mySecurityGroup.Id
}
catch {
    Write-Host $_.Exception.Message -ForegroundColor Red
    Write-Host &quot;Error: Something went wrong with the NIC. Exiting...&quot; -ForegroundColor Red
    Exit
}
################################################################################
# Create the VM config
################################################################################
$vmName = $VHDOSFileNameOnly
Write-Host &quot;Creating the VM config for&quot; $VHDOSFileNameOnly -Foreground Yellow
try {
    $vmConfig = New-AzureRmVMConfig -VMName $vmName -VMSize $myVMSize -ErrorAction Stop
}
catch {
    Write-Host $_.Exception.Message -ForegroundColor Red
    Write-Host &quot;Error: Something went wrong with the VM Config. Exiting...&quot; -ForegroundColor Red
    Exit
}
################################################################################
# Attach the NIC
################################################################################
Write-Host &quot;Attaching the NIC to&quot; $VHDOSFileNameOnly -Foreground Yellow
$vm = Add-AzureRmVMNetworkInterface -VM $vmConfig -Id $nic.Id
################################################################################
# Add the OS disk
################################################################################
Write-Host &quot;Adding the OS disk to&quot; $VHDOSFileNameOnly -Foreground Yellow
try {
    $vm = Set-AzureRmVMOSDisk -VM $vm -ManagedDiskId $osDisk.Id -StorageAccountType StandardLRS `
         -CreateOption Attach -Windows
}
catch {
    Write-Host $_.Exception.Message -ForegroundColor Red
    Write-Host &quot;Error: Something went wrong with the OS disk. Exiting...&quot; -ForegroundColor Red
    Exit
}

################################################################################
# Create the VM
################################################################################
Write-Host &quot;Creating the VM. This will take some time...Hit any key.&quot; $VHDOSFileNameOnly -Foreground Yellow
try {
    New-AzureRmVM -ResourceGroupName $myResourceGroup -Location $myLocation -VM $vm
}
catch {
    Write-Host $_.Exception.Message -ForegroundColor Red
    Write-Host &quot;Error: Something went wrong with the VM creation. Exiting...&quot; -ForegroundColor Red
    Exit
}
################################################################################
# Add the Data disk
################################################################################
if ($myDataVMDKFile -ne &quot;&quot;)
{
    Write-Host &quot;Adding the Data disk to&quot; $VHDDataFileNameOnly -Foreground Yellow
    try {
        $vm = Get-AzureRmVM -Name $VHDOSFileNameOnly -ResourceGroupName $myResourceGroup
        $vm = Add-AzureRmVMDataDisk -VM $vm -ManagedDiskId $DataDisk.Id -StorageAccountType StandardLRS `
             -CreateOption Attach -Lun 1
        Update-AzureRmVM -VM $vm -ResourceGroupName $myResourceGroup
    }
    catch {
        Write-Host $_.Exception.Message -ForegroundColor Red
        Write-Host &quot;Error: Something went wrong with the Data disk. Exiting...&quot; -ForegroundColor Red
        Exit
    }
}
################################################################################
# Finalize
################################################################################
$publicIP = Get-AzureRmPublicIpAddress -Name $ipName -ResourceGroupName $myResourceGroup
$EndDate = (Get-Date)
Write-Host &quot;========================================================================&quot; -ForegroundColor Yellow
Write-Host &quot;CREATION OF THE VM COMPLETED. The IP address is&quot; $publicIP.ipaddress -ForegroundColor Yellow
Write-Host &quot;========================================================================&quot; -ForegroundColor Yellow
Write-Host &quot;=&gt; TOTAL TIME:&quot;($EndDate - $StartDate).Days &quot;days,&quot; ($EndDate - $StartDate).Hours &quot;hours,&quot; ($EndDate - $StartDate).Minutes &quot;minutes.&quot;
</pre>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.andreev.it/2017/10/114-azure-migrate-vm-vcenter-azure/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>AWS: Migrate VMs from VMware vCenter to Amazon AWS using AWS Connector</title>
		<link>https://blog.andreev.it/2017/09/111-aws-migrate-vms-vmware-vcenter-amazon-aws-using-aws-connector/</link>
					<comments>https://blog.andreev.it/2017/09/111-aws-migrate-vms-vmware-vcenter-amazon-aws-using-aws-connector/#respond</comments>
		
		<dc:creator><![CDATA[Kliment Andreev]]></dc:creator>
		<pubDate>Mon, 11 Sep 2017 00:10:55 +0000</pubDate>
				<category><![CDATA[AWS]]></category>
		<category><![CDATA[Cloud]]></category>
		<category><![CDATA[ESX/ESXi]]></category>
		<category><![CDATA[migration]]></category>
		<category><![CDATA[vCenter]]></category>
		<guid isPermaLink="false">http://blog.iandreev.com/?p=3140</guid>

					<description><![CDATA[Recently, I wrote a blog post about migrating VMs from VMware vCenter to AWS&#8230;]]></description>
										<content:encoded><![CDATA[<div id="bsf_rt_marker"></div><p>Recently, I wrote a <a href="https://blog.andreev.it/?p=3065" target="_blank" rel="noopener noreferrer">blog post</a> about migrating VMs from VMware vCenter to AWS using basic export OVA/OVF files. Amazon made a connector that ties your vCenter to AWS so the export is kind of simplified, but the configuration is not. While using the export as OVA/OVF requires you to change the NIC from vmxnet* to e1000 and changing the static IP of your server to DHCP, with AWS Connector you can leave everything as is. Also, the export as OVA/OVF requires your VM to be powered off, while with AWS Connector you can migrate your VMs while they are powered on (using snaps). I also found that AWS Connector is slower than plain export as OVA/OVF. In this post I&#8217;ll show you how to configure the AWS Connector. </p>
<div style="border:1px solid red; padding:16px;">
<p style="text-align:center;"><strong><span style="color:#800000;">IMPORTANT</span> </strong></p>
<p style="text-align:center;"><b>At time of this writing (mid-September 2017), vCenter 6.5 and 7.0 are not supported.</b></p>
<p style="text-align:center;"><b>Make sure you have RDP/SSH enabled on your servers before the migration.</b></p>
</div>
<p>AWS Connector is not just about VM migrations. It has some other useful functions. Check this <a href="https://aws.amazon.com/ec2/vcenter-portal/" target="_blank" rel="noopener noreferrer">web page</a> for more information and this <a href="http://docs.aws.amazon.com/amp/latest/userguide/amp-ug.pdf" target="_blank" rel="noopener noreferrer">PDF </a>for the install/user guide. So, head to <a href="https://aws.amazon.com/ec2/vcenter-portal/" target="_blank" rel="noopener noreferrer">this </a>page first and scroll all the way down to the bottom.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/09/P089-01.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/09/P089-01.png" alt="" width="372" height="378" class="aligncenter size-full wp-image-7669" srcset="https://blog.andreev.it/wp-content/uploads/2017/09/P089-01.png 372w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-01-295x300.png 295w" sizes="(max-width: 372px) 100vw, 372px" /></a><br />
Step 1, Download the AWS Connector. Step 2, click on Setup AWS Management Portal for vCenter. Log in with your AWS account. Click on <strong>Get Started Now</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/09/P089-02.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/09/P089-02.png" alt="" width="907" height="305" class="aligncenter size-full wp-image-7670" srcset="https://blog.andreev.it/wp-content/uploads/2017/09/P089-02.png 907w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-02-300x101.png 300w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-02-768x258.png 768w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-02-585x197.png 585w" sizes="(max-width: 907px) 100vw, 907px" /></a><br />
I will use the first option and most likely you&#8217;ll do. Option 2 is if you have a SSO (Single Sign-On) to AWS.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/09/P089-03.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/09/P089-03.png" alt="" width="1241" height="387" class="aligncenter size-full wp-image-7671" srcset="https://blog.andreev.it/wp-content/uploads/2017/09/P089-03.png 1241w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-03-300x94.png 300w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-03-1024x319.png 1024w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-03-768x239.png 768w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-03-1170x365.png 1170w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-03-585x182.png 585w" sizes="(max-width: 1241px) 100vw, 1241px" /></a><br />
Make sure you have some IAM users defined, otherwise you&#8217;ll receive this error. As a matter of fact, you&#8217;ll want a separate IAM user for this. This user acts as a proxy between AWS and your vCenter.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/09/P089-04.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/09/P089-04.png" alt="" width="473" height="44" class="aligncenter size-full wp-image-7672" srcset="https://blog.andreev.it/wp-content/uploads/2017/09/P089-04.png 473w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-04-300x28.png 300w" sizes="(max-width: 473px) 100vw, 473px" /></a><br />
In my case, I&#8217;ve created a new IAM user called <strong>vCenter</strong>. Check <strong>Programmatic Access</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/09/P089-05.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/09/P089-05.png" alt="" width="1000" height="435" class="aligncenter size-full wp-image-7673" srcset="https://blog.andreev.it/wp-content/uploads/2017/09/P089-05.png 1000w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-05-300x131.png 300w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-05-768x334.png 768w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-05-585x254.png 585w" sizes="(max-width: 1000px) 100vw, 1000px" /></a><br />
On the next screen, click on the <strong>Attach existing policies directly</strong> and in the <strong>Filter: Policy type</strong>, start typing <strong>AWSConnector</strong>. This is an AWS managed policy. Click on the check mark and proceed.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/09/P089-06.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/09/P089-06.png" alt="" width="1141" height="533" class="aligncenter size-full wp-image-7674" srcset="https://blog.andreev.it/wp-content/uploads/2017/09/P089-06.png 1141w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-06-300x140.png 300w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-06-1024x478.png 1024w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-06-768x359.png 768w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-06-585x273.png 585w" sizes="(max-width: 1141px) 100vw, 1141px" /></a><br />
Make sure you download your credentials for this IAM user. They&#8217;ll be saved as <strong>credentials.csv</strong> file on your computer.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/09/P089-07.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/09/P089-07.png" alt="" width="1139" height="348" class="aligncenter size-full wp-image-7675" srcset="https://blog.andreev.it/wp-content/uploads/2017/09/P089-07.png 1139w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-07-300x92.png 300w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-07-1024x313.png 1024w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-07-768x235.png 768w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-07-585x179.png 585w" sizes="(max-width: 1139px) 100vw, 1139px" /></a><br />
Go back to your first tab (or the initial URL) and hit refresh. Type the username vCenter and click on the check mark that you agree.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/09/P089-08.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/09/P089-08.png" alt="" width="1018" height="451" class="aligncenter size-full wp-image-7676" srcset="https://blog.andreev.it/wp-content/uploads/2017/09/P089-08.png 1018w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-08-300x133.png 300w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-08-768x340.png 768w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-08-585x259.png 585w" sizes="(max-width: 1018px) 100vw, 1018px" /></a><br />
The next step tells you to add the admins for AWS Management Portal. Make sure that these accounts are admins in vCenter. In my case, my vCenter is joined to the domain and I am using my own domain account to manage vCenter. You can create a separate user for this, but make sure it&#8217;s a vCenter admin.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/09/P089-09.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/09/P089-09.png" alt="" width="1039" height="546" class="aligncenter size-full wp-image-7677" srcset="https://blog.andreev.it/wp-content/uploads/2017/09/P089-09.png 1039w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-09-300x158.png 300w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-09-1024x538.png 1024w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-09-768x404.png 768w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-09-585x307.png 585w" sizes="(max-width: 1039px) 100vw, 1039px" /></a><br />
Now, this part is very important. I&#8217;ve spent hours troubleshooting this. It was right in front of my eyes, but I didn&#8217;t pay attention.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/09/P089-10.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/09/P089-10.png" alt="" width="525" height="142" class="aligncenter size-full wp-image-7678" srcset="https://blog.andreev.it/wp-content/uploads/2017/09/P089-10.png 525w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-10-300x81.png 300w" sizes="(max-width: 525px) 100vw, 525px" /></a><br />
The easiest way is to open a command prompt from your desktop and type:</p>
<pre class="brush: bash; title: ; notranslate">
set | find &quot;USERDOMAIN&quot;
</pre>
<p>My domain is not andreev. It is actually ANDREEV, so I had to correct the entry.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/09/P089-11.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/09/P089-11.png" alt="" width="506" height="335" class="aligncenter size-full wp-image-7679" srcset="https://blog.andreev.it/wp-content/uploads/2017/09/P089-11.png 506w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-11-300x199.png 300w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-11-263x175.png 263w" sizes="(max-width: 506px) 100vw, 506px" /></a><br />
The last entry will ask you to create an AMP-Connector Key. Just type some name.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/09/P089-12.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/09/P089-12.png" alt="" width="1021" height="282" class="aligncenter size-full wp-image-7680" srcset="https://blog.andreev.it/wp-content/uploads/2017/09/P089-12.png 1021w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-12-300x83.png 300w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-12-768x212.png 768w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-12-585x162.png 585w" sizes="(max-width: 1021px) 100vw, 1021px" /></a><br />
At the end, you&#8217;ll have to download the configuration file. It&#8217;s a text file with some key text in it.<br />
So, you have two files now, one with the credentials for the proxy user and one with the configuration key. After you are done with this, you&#8217;ll land up on this page. You can expand the settings and make sure everything looks OK. You can ignore the <strong>Configure Instance Export</strong> menu. That&#8217;s for S3 exports.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/09/P089-13.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/09/P089-13.png" alt="" width="830" height="456" class="aligncenter size-full wp-image-7681" srcset="https://blog.andreev.it/wp-content/uploads/2017/09/P089-13.png 830w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-13-300x165.png 300w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-13-768x422.png 768w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-13-585x321.png 585w" sizes="(max-width: 830px) 100vw, 830px" /></a><br />
Now, you will need another proxy user, but this time on the vCenter side. It can be a local vCenter user or in my case, I prefer to have an AD account. So, I&#8217;ve created an AD account called <strong>awsconnector</strong>. No special rights needed and don&#8217;t add this account to vCenter. Just create a plain AD account as a <strong>Domain User</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/09/P089-14.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/09/P089-14.png" alt="" width="443" height="379" class="aligncenter size-full wp-image-7682" srcset="https://blog.andreev.it/wp-content/uploads/2017/09/P089-14.png 443w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-14-300x257.png 300w" sizes="(max-width: 443px) 100vw, 443px" /></a><br />
At this point, you should be OK on the AWS side. Head back to your vCenter and deploy the OVA file that you&#8217;ve downloaded.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/09/P089-15.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/09/P089-15.png" alt="" width="418" height="178" class="aligncenter size-full wp-image-7683" srcset="https://blog.andreev.it/wp-content/uploads/2017/09/P089-15.png 418w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-15-300x128.png 300w" sizes="(max-width: 418px) 100vw, 418px" /></a><br />
Once the appliance is provisioned, power it up. If you have a DHCP on your network and you are fine with the DHCP assigned IP on this VM, you don&#8217;t have to do anything. But, I prefer to have a static IP so open the console of this VM and log as <strong>ec2-user</strong> with <strong>ec2pass </strong>as a password. Type <strong>sudo setup.rb</strong>. Type <strong>ec2pass </strong>for password. You should see this menu. Choose <strong>option 2</strong> to assign a static IP if you need. If you are OK with a DHCP, it&#8217;s fine. It&#8217;s up to you.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/09/P089-16.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/09/P089-16.png" alt="" width="869" height="328" class="aligncenter size-full wp-image-7684" srcset="https://blog.andreev.it/wp-content/uploads/2017/09/P089-16.png 869w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-16-300x113.png 300w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-16-768x290.png 768w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-16-585x221.png 585w" sizes="(max-width: 869px) 100vw, 869px" /></a><br />
Once you have the AWS Connector on the network go to <strong>https://aws_connector_IP</strong> address. Make sure to use https. Use your vCenter admin to log in.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/09/P089-17.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/09/P089-17.png" alt="" width="485" height="343" class="aligncenter size-full wp-image-7685" srcset="https://blog.andreev.it/wp-content/uploads/2017/09/P089-17.png 485w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-17-300x212.png 300w" sizes="(max-width: 485px) 100vw, 485px" /></a><br />
Click <strong>Trust </strong>when you get a certificate warning.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/09/P089-18.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/09/P089-18.png" alt="" width="494" height="504" class="aligncenter size-full wp-image-7686" srcset="https://blog.andreev.it/wp-content/uploads/2017/09/P089-18.png 494w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-18-294x300.png 294w" sizes="(max-width: 494px) 100vw, 494px" /></a><br />
You&#8217;ll be prompted to change the web front-end password. There is no user name for this next time you log to your AWS Connector.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/09/P089-19.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/09/P089-19.png" alt="" width="419" height="368" class="aligncenter size-full wp-image-7687" srcset="https://blog.andreev.it/wp-content/uploads/2017/09/P089-19.png 419w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-19-300x263.png 300w" sizes="(max-width: 419px) 100vw, 419px" /></a><br />
Once you log in, this will pop up.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/09/P089-20.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/09/P089-20.png" alt="" width="763" height="531" class="aligncenter size-full wp-image-7688" srcset="https://blog.andreev.it/wp-content/uploads/2017/09/P089-20.png 763w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-20-300x209.png 300w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-20-585x407.png 585w" sizes="(max-width: 763px) 100vw, 763px" /></a><br />
Click <strong>Upload the configuration file</strong>, select the file that you&#8217;ve downloaded from AWS. It&#8217;s called <strong>AMP_Setup_Configuration.txt</strong> and click <strong>Next</strong>. Again, log with your vCenter admin account.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/09/P089-21.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/09/P089-21.png" alt="" width="770" height="534" class="aligncenter size-full wp-image-7689" srcset="https://blog.andreev.it/wp-content/uploads/2017/09/P089-21.png 770w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-21-300x208.png 300w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-21-768x533.png 768w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-21-585x406.png 585w" sizes="(max-width: 770px) 100vw, 770px" /></a><br />
Click <strong>Trust</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/09/P089-22.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/09/P089-22.png" alt="" width="506" height="501" class="aligncenter size-full wp-image-7690" srcset="https://blog.andreev.it/wp-content/uploads/2017/09/P089-22.png 506w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-22-300x297.png 300w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-22-150x150.png 150w" sizes="(max-width: 506px) 100vw, 506px" /></a><br />
Now, enter that AD account that you&#8217;ve just created.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/09/P089-23.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/09/P089-23.png" alt="" width="771" height="544" class="aligncenter size-full wp-image-7691" srcset="https://blog.andreev.it/wp-content/uploads/2017/09/P089-23.png 771w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-23-300x212.png 300w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-23-768x542.png 768w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-23-585x413.png 585w" sizes="(max-width: 771px) 100vw, 771px" /></a><br />
Use the credentials from <strong>credentials.csv</strong> file to enter the username and password. The <strong>Trust Role ARN</strong> field should be automatically populated.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/09/P089-24.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/09/P089-24.png" alt="" width="786" height="530" class="aligncenter size-full wp-image-7692" srcset="https://blog.andreev.it/wp-content/uploads/2017/09/P089-24.png 786w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-24-300x202.png 300w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-24-768x518.png 768w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-24-585x394.png 585w" sizes="(max-width: 786px) 100vw, 786px" /></a><br />
Click on <strong>I agree to install the vCenter SSL certificates</strong>&#8230; otherwise you won&#8217;t be able to proceed and click <strong>Register</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/09/P089-25.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/09/P089-25.png" alt="" width="772" height="545" class="aligncenter size-full wp-image-7693" srcset="https://blog.andreev.it/wp-content/uploads/2017/09/P089-25.png 772w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-25-300x212.png 300w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-25-768x542.png 768w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-25-585x413.png 585w" sizes="(max-width: 772px) 100vw, 772px" /></a><br />
You should get this pop-up which means you are good.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/09/P089-26.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/09/P089-26.png" alt="" width="518" height="158" class="aligncenter size-full wp-image-7694" srcset="https://blog.andreev.it/wp-content/uploads/2017/09/P089-26.png 518w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-26-300x92.png 300w" sizes="(max-width: 518px) 100vw, 518px" /></a><br />
Open the vCenter client and from the <strong>Plug-ins</strong> menu click <strong>Manage Plug-ins</strong>&#8230;The AWS Connector should be enabled.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/09/P089-27.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/09/P089-27.png" alt="" width="758" height="162" class="aligncenter size-full wp-image-7695" srcset="https://blog.andreev.it/wp-content/uploads/2017/09/P089-27.png 758w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-27-300x64.png 300w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-27-585x125.png 585w" sizes="(max-width: 758px) 100vw, 758px" /></a><br />
In the web client it should look like this.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/09/P089-28.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/09/P089-28.png" alt="" width="530" height="366" class="aligncenter size-full wp-image-7696" srcset="https://blog.andreev.it/wp-content/uploads/2017/09/P089-28.png 530w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-28-300x207.png 300w" sizes="(max-width: 530px) 100vw, 530px" /></a><br />
Now, it&#8217;s time to get some action. Pick a VM that you want to migrate to AWS. Did I say that you need RDP/SSH enabled?<br />
Right-click on this VM and choose <strong>Migrate to EC2</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/09/P089-29.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/09/P089-29.png" alt="" width="325" height="404" class="aligncenter size-full wp-image-7697" srcset="https://blog.andreev.it/wp-content/uploads/2017/09/P089-29.png 325w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-29-241x300.png 241w" sizes="(max-width: 325px) 100vw, 325px" /></a><br />
You&#8217;ll get this error. AWS Connector is not yet configured.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/09/P089-30.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/09/P089-30.png" alt="" width="840" height="125" class="aligncenter size-full wp-image-7698" srcset="https://blog.andreev.it/wp-content/uploads/2017/09/P089-30.png 840w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-30-300x45.png 300w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-30-768x114.png 768w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-30-585x87.png 585w" sizes="(max-width: 840px) 100vw, 840px" /></a><br />
All right, so go to <strong>Home -> AWS Management Portal</strong> in vCenter and add the preferred region.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/09/P089-31.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/09/P089-31.png" alt="" width="403" height="452" class="aligncenter size-full wp-image-7699" srcset="https://blog.andreev.it/wp-content/uploads/2017/09/P089-31.png 403w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-31-267x300.png 267w" sizes="(max-width: 403px) 100vw, 403px" /></a><br />
Click on <strong>Create an environment</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/09/P089-32.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/09/P089-32.png" alt="" width="494" height="479" class="aligncenter size-full wp-image-7700" srcset="https://blog.andreev.it/wp-content/uploads/2017/09/P089-32.png 494w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-32-300x291.png 300w" sizes="(max-width: 494px) 100vw, 494px" /></a><br />
Select your VPC and choose all subnets.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/09/P089-33.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/09/P089-33.png" alt="" width="724" height="538" class="aligncenter size-full wp-image-7701" srcset="https://blog.andreev.it/wp-content/uploads/2017/09/P089-33.png 724w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-33-300x223.png 300w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-33-585x435.png 585w" sizes="(max-width: 724px) 100vw, 724px" /></a><br />
Go back to your VM and try to migrate it to EC2.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/09/P089-34.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/09/P089-34.png" alt="" width="713" height="607" class="aligncenter size-full wp-image-7702" srcset="https://blog.andreev.it/wp-content/uploads/2017/09/P089-34.png 713w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-34-300x255.png 300w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-34-585x498.png 585w" sizes="(max-width: 713px) 100vw, 713px" /></a><br />
Oh, snap!<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/09/P089-35.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/09/P089-35.png" alt="" width="544" height="183" class="aligncenter size-full wp-image-7703" srcset="https://blog.andreev.it/wp-content/uploads/2017/09/P089-35.png 544w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-35-300x101.png 300w" sizes="(max-width: 544px) 100vw, 544px" /></a><br />
Go to vCenter roles, and follow up the instructions from above.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/09/P089-36.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/09/P089-36.png" alt="" width="669" height="677" class="aligncenter size-full wp-image-7704" srcset="https://blog.andreev.it/wp-content/uploads/2017/09/P089-36.png 669w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-36-296x300.png 296w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-36-585x592.png 585w" sizes="(max-width: 669px) 100vw, 669px" /></a><br />
Then again, go back to your VM, right-click and choose <strong>Migrate to EC2</strong>. You&#8217;ll get this warning. It pretty much tells you that while migrating the VM will be slow.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/09/P089-37.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/09/P089-37.png" alt="" width="475" height="129" class="aligncenter size-full wp-image-7705" srcset="https://blog.andreev.it/wp-content/uploads/2017/09/P089-37.png 475w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-37-300x81.png 300w" sizes="(max-width: 475px) 100vw, 475px" /></a><br />
Once the migration starts you&#8217;ll see this.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/09/P089-38.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/09/P089-38.png" alt="" width="678" height="249" class="aligncenter size-full wp-image-7706" srcset="https://blog.andreev.it/wp-content/uploads/2017/09/P089-38.png 678w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-38-300x110.png 300w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-38-585x215.png 585w" sizes="(max-width: 678px) 100vw, 678px" /></a><br />
Do that. Go to <strong>Home -> AWS Management Portal -> Dashboard</strong> in vCenter. You&#8217;ll see the progress. If you scroll to the right you can actually see how much is uploaded. AWS is uploading the snap, so my VM has a 30GB disk (thick provisioned), but it was a plain vanilla OS with nothing installed except a text file on the desktop. So the actual size for upload is 4GB.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/09/P089-39.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/09/P089-39.png" alt="" width="1149" height="826" class="aligncenter size-full wp-image-7707" srcset="https://blog.andreev.it/wp-content/uploads/2017/09/P089-39.png 1149w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-39-300x216.png 300w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-39-1024x736.png 1024w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-39-768x552.png 768w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-39-585x421.png 585w" sizes="(max-width: 1149px) 100vw, 1149px" /></a><br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/09/P089-40.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/09/P089-40.png" alt="" width="909" height="40" class="aligncenter size-full wp-image-7708" srcset="https://blog.andreev.it/wp-content/uploads/2017/09/P089-40.png 909w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-40-300x13.png 300w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-40-768x34.png 768w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-40-585x26.png 585w" sizes="(max-width: 909px) 100vw, 909px" /></a><br />
Once your migration completes, you can find your instance/VM under <strong>IMAGES | AMIs</strong> in AWS console.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/09/P089-41.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/09/P089-41.png" alt="" width="594" height="34" class="aligncenter size-full wp-image-7709" srcset="https://blog.andreev.it/wp-content/uploads/2017/09/P089-41.png 594w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-41-300x17.png 300w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-41-585x34.png 585w" sizes="(max-width: 594px) 100vw, 594px" /></a><br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/09/P089-42.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/09/P089-42.png" alt="" width="578" height="211" class="aligncenter size-full wp-image-7710" srcset="https://blog.andreev.it/wp-content/uploads/2017/09/P089-42.png 578w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-42-300x110.png 300w" sizes="(max-width: 578px) 100vw, 578px" /></a><br />
Right-click on the AMI, choose <strong>Launch</strong>, follow the prompts and you should be all set. You&#8217;ll have to specify a key, but you can use your local admin credentials to log in.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/09/P089-43.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/09/P089-43.png" alt="" width="1231" height="233" class="aligncenter size-full wp-image-7711" srcset="https://blog.andreev.it/wp-content/uploads/2017/09/P089-43.png 1231w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-43-300x57.png 300w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-43-1024x194.png 1024w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-43-768x145.png 768w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-43-1170x221.png 1170w, https://blog.andreev.it/wp-content/uploads/2017/09/P089-43-585x111.png 585w" sizes="(max-width: 1231px) 100vw, 1231px" /></a></p>
<div style="border:1px solid red; padding:16px;">
<p style="text-align:center;"><strong><span style="color:#800000;">IMPORTANT</span> </strong></p>
<p style="text-align:center;"><b>Make sure you have all your licensing in place. If your on-prem VM uses KMS for licensing, the migrated instance in AWS will need access to your KMS server.</b></p>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.andreev.it/2017/09/111-aws-migrate-vms-vmware-vcenter-amazon-aws-using-aws-connector/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>AWS: Migrate VMs from VMware vCenter to Amazon AWS</title>
		<link>https://blog.andreev.it/2017/07/108-aws-migrate-vms-vmware-vcenter-amazon-aws/</link>
					<comments>https://blog.andreev.it/2017/07/108-aws-migrate-vms-vmware-vcenter-amazon-aws/#respond</comments>
		
		<dc:creator><![CDATA[Kliment Andreev]]></dc:creator>
		<pubDate>Sat, 15 Jul 2017 22:07:43 +0000</pubDate>
				<category><![CDATA[AWS]]></category>
		<category><![CDATA[Cloud]]></category>
		<category><![CDATA[ESX/ESXi]]></category>
		<category><![CDATA[migration]]></category>
		<category><![CDATA[vCenter]]></category>
		<guid isPermaLink="false">http://blog.iandreev.com/?p=3065</guid>

					<description><![CDATA[I needed to move some VMs from my home lab (vCenter 5.5) to my&#8230;]]></description>
										<content:encoded><![CDATA[<div id="bsf_rt_marker"></div><p>I needed to move some VMs from my home lab (vCenter 5.5) to my Amazon AWS cloud account. This is what I did.<br />
First, you have to prepare the VM. If you have any vmxnet* network card, you have to delete it from the properties of the VM in vCenter. Second, make sure that you have RDP or SSH enabled on the VM and third, uninstall the VMware tools. Shut down the VM, add an E1000 NIC and power it up again. Make sure that the TCP/IP and DNS settings for the new NIC are set for DHCP. Verify that all these requirements apply and then shut down the VM again.<br />
In vCenter, select the VM for export, click on <strong>File | Export</strong> and then <strong>Export OVF</strong> template. Choose Single file (OVA).<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/07/P086-01.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/07/P086-01.png" alt="" width="606" height="439" class="aligncenter size-full wp-image-7647" srcset="https://blog.andreev.it/wp-content/uploads/2017/07/P086-01.png 606w, https://blog.andreev.it/wp-content/uploads/2017/07/P086-01-300x217.png 300w, https://blog.andreev.it/wp-content/uploads/2017/07/P086-01-585x424.png 585w" sizes="(max-width: 606px) 100vw, 606px" /></a><br />
Once the export is completed, you have to upload the OVA file to a S3 bucket. I created a new bucket for this, called <strong>uploadvmstuff </strong>with the default settings. You&#8217;ll have to pick a unique name for the bucket, but you probably know that. Upload your OVA file to S3. It might take a while depending how big the file is. </p>
<p>I am using my admin account in AWS to import the VM, but I still have to assign some policies. So, when the upload is complete, go to the command prompt or PowerShell on your desktop. Make sure you have AWS CLI installed. You can check my <a href="https://blog.andreev.it/?p=1905" target="_blank" rel="noopener noreferrer">other </a>blog post on how to do this. Very simple. </p>
<p>Create these three files in Notepad and save them on the desktop. The first file is called <strong>trust-policy.json</strong>. See this <a href="http://docs.aws.amazon.com/vm-import/latest/userguide/vmimport-image-import.html#w2ab1b9c15b7" target="_blank" rel="noopener noreferrer">link </a>for more info. </p>
<pre class="brush: xml; title: ; notranslate">
{
   &quot;Version&quot;: &quot;2012-10-17&quot;,
   &quot;Statement&quot;: &#x5B;
      {
         &quot;Effect&quot;: &quot;Allow&quot;,
         &quot;Principal&quot;: { &quot;Service&quot;: &quot;vmie.amazonaws.com&quot; },
         &quot;Action&quot;: &quot;sts:AssumeRole&quot;,
         &quot;Condition&quot;: {
            &quot;StringEquals&quot;:{
               &quot;sts:Externalid&quot;: &quot;vmimport&quot;
            }
         }
      }
   ]
}
</pre>
<p>Execute this command from the command prompt. Make sure that you are in the same folder in the command prompt where you saved your files, e.g. <strong>cd c:\users\whatever\desktop</strong>. </p>
<pre class="brush: bash; title: ; notranslate">
aws iam create-role --role-name vmimport --assume-role-policy-document file://trust-policy.json
</pre>
<p>Create the 2nd file called <strong>role-policy.json</strong> so it looks like this. Replace the two occurrences of <strong>disk-image-file-bucket</strong> with your bucket name, in my case it was <strong>uploadvmstuff</strong>.</p>
<pre class="brush: xml; title: ; notranslate">
{
   &quot;Version&quot;: &quot;2012-10-17&quot;,
   &quot;Statement&quot;: &#x5B;
      {
         &quot;Effect&quot;: &quot;Allow&quot;,
         &quot;Action&quot;: &#x5B;
            &quot;s3:ListBucket&quot;,
            &quot;s3:GetBucketLocation&quot;
         ],
         &quot;Resource&quot;: &#x5B;
            &quot;arn:aws:s3:::disk-image-file-bucket&quot;
         ]
      },
      {
         &quot;Effect&quot;: &quot;Allow&quot;,
         &quot;Action&quot;: &#x5B;
            &quot;s3:GetObject&quot;
         ],
         &quot;Resource&quot;: &#x5B;
            &quot;arn:aws:s3:::disk-image-file-bucket/*&quot;
         ]
      },
      {
         &quot;Effect&quot;: &quot;Allow&quot;,
         &quot;Action&quot;:&#x5B;
            &quot;ec2:ModifySnapshotAttribute&quot;,
            &quot;ec2:CopySnapshot&quot;,
            &quot;ec2:RegisterImage&quot;,
            &quot;ec2:Describe*&quot;
         ],
         &quot;Resource&quot;: &quot;*&quot;
      }
   ]
}
</pre>
<p>Execute this command from the command prompt.</p>
<pre class="brush: bash; title: ; notranslate">
aws iam put-role-policy --role-name vmimport --policy-name vmimport --policy-document file://role-policy.json
</pre>
<p>The third file is called <strong>containers.json</strong> and it looks like this. Change the lines so it matches your settings. For <strong>Description </strong>use whatever you want, change the <strong>S3Bucket </strong>line and the <strong>S3Key</strong>. The <strong>S3Key </strong>is the name of the ova file that you&#8217;ve exported from vCenter. </p>
<pre class="brush: xml; title: ; notranslate">
&#x5B;
  {
    &quot;Description&quot;: &quot;Windows 2008R2 Import&quot;,
    &quot;Format&quot;: &quot;ova&quot;,
    &quot;UserBucket&quot;: {
        &quot;S3Bucket&quot;: &quot;uploadvmstuff&quot;,
        &quot;S3Key&quot;: &quot;nvm.ova&quot;
    }
}]
</pre>
<p>Now, you are ready to import the file from S3 to EC2. Execute this line from the command prompt.</p>
<pre class="brush: bash; title: ; notranslate">
aws ec2 import-image --description &quot;Windows 2008R2 VMDKs&quot; --license-type BYOL --disk-containers file://containers.json
</pre>
<p>You should get your prompt back after 2-3 seconds. But, this means that the import started, not that it finished. To check the status, execute this line.</p>
<pre class="brush: bash; title: ; notranslate">
aws ec2 describe-import-image-tasks
</pre>
<p>It takes some time, for my OVA file that was created from a 40GB disk and 3.7GB OVA file it took about 20-25 mins. You will see the <strong>Status </strong>change to completed once everything is OK. Make sure that your AWS CLI is configured to do the output in JSON so it&#8217;s easy to see. </p>
<p>Once completed, you will see your import in the AMI section of EC2. Go to EC2 section, click Launch New Instance and choose the AMI that you just created. Follow the standard prompts for the type of the instance, security groups, volumes, etc&#8230; and once your instance is launched you can RDP to it. You will use the same admin password as before to RDP.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.andreev.it/2017/07/108-aws-migrate-vms-vmware-vcenter-amazon-aws/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
