Rather than attempting to migrate a virtual machine from your source VMware ESXi host to your destination VMware ESXi host, you can test network connectivity between them from the command line.
To do this, you must first start the "TSM-SSH" service on your VMware ESXi host so that the SSH protocol is enabled on it.
If you are using the web client (VMware Host client) on your VMware ESXi host, go to "Host -> Manage -> Services", select the "TSM-SSH" service and click "Start".
If you are using the web client (VMware vSphere Client) of your VMware vCenter Server, select the desired VMware ESXi host, then go to "Configure -> System -> Services".
Next, select the "SSH" service and click "Start".
Launch your preferred SSH client (for example: PuTTY), provide the domain name or IP address of the VMware ESXi host where you just enabled the SSH protocol and click Open.
To list the VMkernel interfaces available on your VMware ESXi host, use the command:
Bash
esxcli network ip interface ipv4 get
Which gives this on our VMware ESXi host source "esxi1":
Plain Text
Name IPv4 Address IPv4 Netmask IPv4 Broadcast Address Type Gateway DHCP DNS ---- ------------ ------------- -------------- ------------ -------- -------- vmk0 10.0.0.11 255.255.255.0 10.0.0.255 STATIC 10.0.0.1 false vmk1 10.10.0.11 255.255.255.0 10.10.0.255 STATIC 0.0.0.0 false
And this on the destination one (esxi2).
Plain Text
Name IPv4 Address IPv4 Netmask IPv4 Broadcast Address Type Gateway DHCP DNS ---- ------------ ------------- -------------- ------------ -------- -------- vmk0 10.0.0.12 255.255.255.0 10.0.0.255 STATIC 10.0.0.1 false vmk1 10.10.0.12 255.255.255.0 10.10.0.255 STATIC 0.0.0.0 false
To find the system name of the TCP/IP stack used by each of these VMkernel interfaces, use the command:
Bash
esxcli network ip interface list |grep -E 'vmk|Netstack'
As you can see, in our case:
Plain Text
vmk0 Name: vmk0 Netstack Instance: defaultTcpipStack vmk1 Name: vmk1 Netstack Instance: vmotion
To test the network connectivity between your 2 VMware ESXi hosts for vMotion traffic, you will need to use the "vmkping" command available on VMware ESXi.
Indeed, if you try to do a classic ping between your 2 hosts, the network packets will be sent via the VMkernel "vmk0" interface which provides, by default, the "Management" service. However, what we want to test is the connectivity between our VMkernel interfaces intended for the use of vMotion.
To test the network connectivity between your 2 VMkernel "vmk1" interfaces (where the vMotion service is activated), use the "vmkping" command by specifying:
Note that if the "-S" parameter is not specified, the vmkping command will default to your VMware ESXi host's default TCP/IP stack.
Bash
vmkping -S vmotion -I vmk1 10.10.0.12
Plain Text
PING 10.10.0.12 (10.10.0.12): 56 data bytes 64 bytes from 10.10.0.12: icmp_seq=0 ttl=64 time=0.482 ms 64 bytes from 10.10.0.12: icmp_seq=1 ttl=64 time=0.761 ms 64 bytes from 10.10.0.12: icmp_seq=2 ttl=64 time=0.778 ms --- 10.10.0.12 ping statistics --- 3 packets transmitted, 3 packets received, 0% packet loss round-trip min/avg/max = 0.482/0.674/0.778 ms
If this error appears, make sure that:
- the network cables are correctly connected
- the IP address indicated corresponds to the VMKernel specified as a parameter (vmk1 in this case)
Plain Text
PING 10.0.0.12 (10.0.0.12): 56 data bytes sendto() failed (Network is unreachable)
If you see this error, make sure you have specified the VMkernel interface through which you are using the "vMotion" TCP/IP stack.
This is because the "-S vmotion" parameter of this vmkping command expects to test the network connection via the "vMotion" TCP/IP stack.
Plain Text
Unknown interface 'vmk0': Invalid argument
To test vMotion network connectivity, you can also use the command below.
Again, you must specify:
Bash
esxcli network diag ping -I vmk1 --netstack=vmotion -H 10.10.0.12
If it's good :
Plain Text
Trace: Received Bytes: 64 Host: 10.10.0.12 ICMP Seq: 0 TTL: 64 Round-trip Time: 485 us Dup: false Detail: ... Summary: Host Addr: 10.10.0.12 Transmitted: 3 Received: 3 Duplicated: 0 Packet Lost: 0 Round-trip Min: 485 us Round-trip Avg: 738 us Round-trip Max: 1236 us
If there is a problem, you will see that:
Plain Text
Trace: Summary: Host Addr: 10.10.0.12 Transmitted: 3 Received: 0 Duplicated: 0 Packet Lost: 100 Round-trip Min: 999999000 us Round-trip Avg: -2147483648 us Round-trip Max: 0 us
To know the name of your VMkernel interfaces, the IP address assigned to them and the TCP/IP stack used by each of them, you can also select your VMware ESXi host in the web client of your VMware vCenter Server and go to the section: Configure -> Networking -> VMkernel adapters.
However, be careful that the name of the TCP/IP stack displayed in this web client is different from the system name expected by the commands cited above.
The system names of TCP/IP stacks under VMware ESXi 6.7.0 are:
On a VMware vCenter Server, a virtual network (or "port group" in the VMware ESXi web client) is unique per data center.
This means that you can easily migrate virtual machines from one VMware ESXi host to another without losing network connections if they are part of the same data center.
As you can see, in our case, we have a virtual network "VM Network" whose name is identical on our 2 VMware ESXi hosts.
This virtual network is the one created by default under VMware ESXi to provide network and Internet access (if applicable) to your virtual machines.
If you click on the name of this virtual network, you will see that it is used by 2 hosts.
Now that everything is configured, you can easily migrate virtual machines from one VMware ESXi host to another from the "VMware vSphere Client" web client of your VMware vCenter Server (VCSA).
To migrate a virtual machine (whether it is started or not), select it, then click: Actions -> Migrate.
In the "[VM name] - Migrate" window that appears, for the migration type, select "Change both compute resource and storage", then click Next.
Explanations:
In the "Select a compute resource" step, select the VMware ESXi host to which you want to migrate this virtual machine, then click Next.
In our case: esxi2.informatiweb.lan.
In this tutorial, we will migrate a virtual machine between 2 hosts that are part of the same data center.
However, be aware that it is also possible to migrate virtual machines from one data center to another, or even from one vCenter server to another.
That said, this may require a specific edition of VMware vSphere. What you will see in other tutorials.
In the "Select storage" step, first select in which datastore of the destination VMware ESXi host you want to store this virtual machine.
When you migrate a virtual machine, you have the option to change the virtual disk format (.vmdk) if you wish.
In other words: change the type of provisioning used (thick or thin).
By default, the destination format will be the same as the source format.
In the "Select networks" step, you can map the different virtual networks used by the source virtual machine to the virtual networks of the destination host.
By default, the selected destination network is the one whose name is identical to the source virtual network.
Hence the interest in using identical names on your different VMware ESXi hosts when a virtual network on one VMware ESXi host points to the same physical network on the other VMware ESXi host.
Warning : so that the virtual machine is still accessible on the network after its migration, it is important that the IP address of the source network is identical to that of the destination.
Otherwise, some manipulation may be required in the operating system for the virtual machine to obtain a new IP address corresponding to the remote network.
Important : virtual network names are unique only within a data center.
In the "Select vMotion priority" step, you can choose the priority of this vMotion migration:
Note that if no migration is currently in progress in your case, choosing either option will make absolutely no difference.
This will start directly in both cases.
However, choosing "Schedule normal vMotion" now will allow you to launch a priority migration a little later if necessary if you wish, even if the one with normal priority is not completed.
A summary of your virtual machine migration configuration appears.
Click "Finish" to start migrating this virtual machine.
Once the vMotion migration has started, you will see a "Replace virtual machine" task appear at the bottom of the screen with the name of the virtual machine being migrated as the target.
During the migration, several actions will be grayed out for the affected virtual machine.
Towards the end of the migration of your virtual machine, you will see this appear in the details of your task: Migrating the active state of the virtual machine.
Then, once the migration of your virtual machine is complete, you will see that its host will have changed, as well as the datastore where it is located.
On the other hand, the state of its guest operating system will have been preserved and it will not have been interrupted during the migration.
As you can see, because we changed the compute resource and storage, the files making up your virtual machine will also have been moved to the destination VMware ESXi host.
Note that migrating a virtual machine's storage will automatically rename all its files to its current name.
This can be practical in business to maintain a concordance between the name of the virtual machines visible in the inventory of your VMware vCenter Server and the name of the folders visible in your different datastores.
VMware 7/29/2022
VMware 7/19/2024
VMware 6/19/2024
VMware 11/22/2024
Pinned content
Contact
® InformatiWeb-Pro.net - InformatiWeb.net 2008-2022 - © Lionel Eppe - All rights reserved.
Total or partial reproduction of this site is prohibited and constitutes an infringement punishable by articles L.335-2 and following of the intellectual property Code.
No comment