Host-based backup of VMware vSphere VMs.
Post Reply
lrhazi
Enthusiast
Posts: 94
Liked: 3 times
Joined: Jan 03, 2017 8:15 pm
Full Name: Mohamed Lrhazi
Contact:

Restore to ec2: How does IP addressing work?

Post by lrhazi »

So we backup our VMs, mostly MS Windows, and offload to S3. I know we have the option to directly restore to ec2.
Our VMs all have their IPs assigned statically.... How would you fix the network config in ec2? Do you restore, then console in and change the NIC to DHCP?
Can this be automated somehow?
EugeneK
Veeam Software
Posts: 170
Liked: 43 times
Joined: Mar 19, 2016 10:57 pm
Full Name: Eugene Kashperovetskyi
Location: Chicago, IL
Contact:

Re: Restore to ec2: How does IP addressing work?

Post by EugeneK »

Creating a new Amazon VPC with the matching IP subnet would make the static IPs already assigned to the VMs valid. Is that an option in your scenario?
Eugene K
VMCA, VCIX-DCV, vExpert
lrhazi
Enthusiast
Posts: 94
Liked: 3 times
Joined: Jan 03, 2017 8:15 pm
Full Name: Mohamed Lrhazi
Contact:

Re: Restore to ec2: How does IP addressing work?

Post by lrhazi »

That would be great! is that an option? if my VMs are not using DHCP, would it just work still? I thought ec2 assumes instances are using dhcp and honoring the assigned IPs?
lrhazi
Enthusiast
Posts: 94
Liked: 3 times
Joined: Jan 03, 2017 8:15 pm
Full Name: Mohamed Lrhazi
Contact:

Re: Restore to ec2: How does IP addressing work?

Post by lrhazi »

Actually, it does not look like I could even console in, to manually fix the network config!
How do people do "restore to ec2" ? is DHCP assumed to be used?
tsightler
VP, Product Management
Posts: 6013
Liked: 2843 times
Joined: Jun 05, 2009 12:57 pm
Full Name: Tom Sightler
Contact:

Re: Restore to ec2: How does IP addressing work?

Post by tsightler » 2 people like this post

When you perform the restore to EC2 part of the import/conversion process adds a new NIC adapter and, since this is a new adapter vs the one used on-premises, it is configured for DHCP so it will pick up the new address from the associated VPC. For example, in my lab I have a system with a static IP of 192.160.10.12 using a VMXNET3 virtual NIC, however, when I restore that system to EC2 and select a VPC, which uses 172.16.10.0/24, the restored system ends up with a new virtual NIC which pulls it's IP address from that VPC pool.
cgsm
Enthusiast
Posts: 93
Liked: 19 times
Joined: Oct 05, 2021 3:55 pm
Contact:

Re: Restore to ec2: How does IP addressing work?

Post by cgsm »

lrhazi wrote: Nov 18, 2021 2:15 am Actually, it does not look like I could even console in, to manually fix the network config!
How do people do "restore to ec2" ? is DHCP assumed to be used?
Restoring to EC2 with static IPs is a bit more complicated than I would like, but I have accomplished it through a lot of trial and error.
  • First, you need to create a VPC with a matching subnet (i.e.: if you on-premise LAN is 192.168.1.1/24, create a VPC with this exact same subnet as well.
  • Next, restore a VM to EC2 choosing the correct subnet.
Now, you have two options to set the "correct" (as set in your on-premise LAN) IP.
  • Once the VM is restored, there is an option under the instance's networking to set the static IP. You have to set the static IP manually since the network adapter assigned to the instance is "new" and therefore doesn't inherit the static IP.
  • Or, you can boot the restored VM and it will be assigned a random IP via DHCP in your subnet. Then, since you realized you cannot remote into it (your restored VM doesn't have the necessary EC2 stuff set for this to work), you can deploy an AWS Windows Server instance (which will have RDP working), make the newly deployed instance publicly accessible, remote into it, then remote into your restored VM, and finally assign a static IP using Windows.
Now, I haven't tested how complicated this would get with restoring a bunch of VMs at once, if setting a static IP on one instance prevents other instances from being assigned the same IP via DHCP (not sure if you can set a DHCP range in a VPC), or if the static IP set will get removed after reboots/instance resets/AWS network issues/etc.
lrhazi
Enthusiast
Posts: 94
Liked: 3 times
Joined: Jan 03, 2017 8:15 pm
Full Name: Mohamed Lrhazi
Contact:

Re: Restore to ec2: How does IP addressing work?

Post by lrhazi » 1 person likes this post

Thanks guys! I have been googling and am surprised I could not find much about this! I would have assumed it's a solved issue (and a common use case)!
lrhazi
Enthusiast
Posts: 94
Liked: 3 times
Joined: Jan 03, 2017 8:15 pm
Full Name: Mohamed Lrhazi
Contact:

Re: Restore to ec2: How does IP addressing work?

Post by lrhazi »

It turns out you cannot change the primary private IP assigned to an instance after it was launched.
It seems when the instance is created by Veeam, even as I checked "Do not power it on"... it is still past the "launch" phase and won't let me change the IP.
lothargr
Service Provider
Posts: 10
Liked: 3 times
Joined: Dec 06, 2010 1:23 pm
Contact:

Re: Restore to ec2: How does IP addressing work?

Post by lothargr » 1 person likes this post

Hello everyone,

I assume that the this "issue" is not resolved yet because we get the same behaviour in our "restore to ec2" test.

Please let me know if anyone has any update on the matter.

Regards.
Post Reply

Who is online

Users browsing this forum: No registered users and 46 guests