A. Hyper-V stores configurations in XML files. Part of that configuration file for the network adapter includes the device GUID of the network adapter. This GUID is unique for each VM, so if I create a new VM with the exact same configuration for an existing VHD, the network adapter will have a new device ID and therefore be treated as a new piece of hardware, losing any static IP configuration.
It isn't supported, but you can copy the device GUID from the network adapter in the old configuration file into the new configuration file. Doing so makes the VM think it's the same network device and thus maintains any configuration related to the adapter, such as IP address.
Open the old configuration file and locate the network adapter section. It will look like the following:
<_cb6dd1a0-c17d-4394-b5b9-9894ff971996_>\{f07d99f3-06dc-40ea-a1b8-25c3a8d04491\}& lt;/ChannelInstanceGuid> Network Adapter True 00-15-5D-01-1F-0E False 84274ff9-5a3c-47bf-9bb4-b97cbec1ec3d Switch-SM-036bf681-40b0-4c47- bad3-3b131c1fbb98-0
Note the FriendlyName, which tells us it's the Network Adapter. The device ID is the ChannelInstanceGUID. Copy the value in the curly brackets (\{\}) and paste over the ChannelInstanceGUID in the new VM's configuration file.
Related Reading:
- Virtualization Myths and Misconceptions
- Q. I'm seeing a big performance difference with my live migration operations when I use Cluster Shared Volumes (CSV), is this normal?
- Q. How can I list all applications being published from a Windows Virtual PC virtual machine (VM)?
- Q. Why are my virtual machines (VMs) migrated between nodes in a cluster using Quick Migration instead of Live Migration when I shut down a cluster node?
Check out hundreds more useful Q&As like this in John Savill's FAQ for Windows. Also, watch instructional videos made by John at ITTV.net.