
This article is intended for administrators wishing to utilize StorMagic VMware VM Import engine included in SvHCI 2.1.0 or higher to import VMware Virtual Machines across into SvHCI either cold (powered off) SvHCI ≤ 2.3, or warm (powered on) SvHCI ≥ 2.4
Note: All images are clickable for enlarging, or can be opened in a new tab
Resolution/Information
Table of Contents
- Summary
- Required Firewall Ports
- Windows VM Import Prerequisites
- Trigger box Configuration and Setup
- Command Parameters
- Cold Import vs Warm Import
- Help Syntax
- Example Command
- Example Warm VM Import Walkthrough
- Example Multiple VM import
- Example Copy Speed
- Troubleshooting
Summary
The StorMagic SvHCI VMware Virtual Machine import utility consists of an engine within the SvHCI node that is triggered to import a VMware virtual machine from a client device via a python script.
The intent of this model is the ability to potentially trigger VM imports via a centralized automated script, with the VM import running within a remote LAN network.
The SvHCI node may be triggered to import the Virtual Machines, talking either to vCenter or direct to an ESXi host over any vmkernel adapter, e.g. even able to chat direct to ESXi over a faster network link, such as a direct attach cable between the nodes.
The workflow for Warm Import is akin:
- trigger the SvHCI node to start the import of a Virtual machine from vCenter or ESXi node
- this will trigger a non-quiesced snapshot, so as to not impact VM Production, of the virtual machine in VMware named "StorMagicWarmImport". Note that any existing snapshots will need to be merged back in before Warm import is possible.
3. this data is streamed out of VMware across to SvHCI
4. This snapshot will then be consolidated, being one 'iteration' against the VM
5. The VM will go through repeated iterations until the sysadmin is ready to cutover
6. At cutover the Virtual Machine is power down, either in guest (preferred as VMware tools already removed), or via VMware tools. This will quiesce down the final Virtual Machine I/O.
7. The virtual machine will then be recreated with the matching virtual machine hardware settings, including MAC addresses, in SvHCI.
8. The original Virtual Machine is untouched in VMware from the shutdown, should the sysadmin wish to "back out", by powering the Virtual Machine back on in VMware, noting that the import would need to be reattempted at a later time.
Note: The import utility script is included in both SvHCI firmware image and ISO download packages as well as being included at the bottom of this KB
Required Firewall Ports
| Item/Service | Communicating between | Port | Protocol | Notes |
| VM Import (from vSphere) |
SvHCI --> vSphere (vCSA or ESXi) |
902 | UDP/TCP | The SvHCI calls out to vSphere over 902 to check the VM config and trigger the import |
Windows VM Import Prerequisites
To ensure Windows VMs import correctly please ensure they're booting/running on SvHCI supported virtual hardware.
- from a VMware Paravirtual SCSI controller within VMware prior to import.
If they're still on LSI Logic SAS this can be modified via the below steps:
This example utilized a Guest VM Base system installed from VMware defaults for a Windows Server 2016 template.
- UEFI, LSI SAS, E1000E
- Install VMware tools, if not already present, to install drivers (VMXNET3 and PVSCSI)
- Shut down
- Add a new a new SCSI controller
setting it to VMware Paravirtual (pvscsi), typically SCSI controller 1
- Boot up - to ensure the drivers for the pvscsi controller are loaded into the Windows Operating System
This controller will display in Device Manager
- Power Down.
- Transition SCSI controller 0 from LSI Logic SAS to VMware Paravirtual
- Remove the SCSI controller 1
- Boot up in VMware - should boot fine, reboot to verify.
- Power down.
The virtual machine is now ready to run on SvHCI and may be either:
- Imported via the StorMagic VM import utility detailed below
- Exported to OVF,
- or pull the VMDK via datastore browser and upload into SvHCI
Trigger box Configuration and Setup
Download and install python to your operating system of choice. The below demo's install ing on Windows 11.
From a Windows Terminal sessino type 'python' to install via Microsoft Marketplace
Type "py install default"
And validate the vm_import.py file will now run by running with the -h switch:
Command Parameters
| Parameter | Description |
|---|---|
| vsphere-hostname | the network hostname or IP of the vSphere node, be it vCenter or an ESXi host |
| vsphere-username | the username, e.g. administrator@vsphere.local or similar if vCenter or root if an ESXi host |
| vsphere-password | The password for the VMware node |
| hostname | The SvHCI hostname or IP address |
| password | The password for the SvHCI node |
| pool | The pool storage to import the VMware virtual machine onto (case sensitive) |
| vm name | The VM object name in VMware (case sensitive) |
| remote pool | The remote pool name, adds VM protection |
| warm | Import the VM while still powered on in VMware |
| threshold | Automatically cutover the VM at a data threshold (wam only) |
| power | Automatically power on the VM in SvHCI after shutdown/power off in VMware |
Cold Import vs Warm Import
SvHCI can import VMs from VMware cold, with the virtual machine shutdown, however with large VMs or a lot of data to copy this can result in large periods of VM copy time and the application not available.
SvHCI 2.4.0 or higher introduces Warm import. This enables the guest VM to be live while the data is copied across via change block tracking, utilizing VM snapshots.
This ensures the majority of data is copied while the VM is still running in production in VMware and a desired 'cutover' period may be chosen to shut down the VM and bring it back online in SvHCI.
Help syntax
PS C:\svhci-vm-import\warm> python.exe .\vm_import.py -h
usage: vm_import.py [-h] [--defaults DEFAULTS] [--hostname HOSTNAME] [--password PASSWORD]
[--vsphere-hostname VSPHERE_HOSTNAME] [--vsphere-username VSPHERE_USERNAME]
[--vsphere-password VSPHERE_PASSWORD] [--vm-name VM_NAME] [--pool POOL]
[--remote-pool REMOTE_POOL] [--warm] [--threshold THRESHOLD] [--power]
SvHCI VM import from vSphere ESXi/VCSA
options:
-h, --help show this help message and exit
--defaults DEFAULTS Path to defaults file (key=value per line)
--hostname HOSTNAME SvHCI hostname
--password PASSWORD Password for authentication
--vsphere-hostname VSPHERE_HOSTNAME
vSphere ESXi/VCSA address
--vsphere-username VSPHERE_USERNAME
Username for vSphere authentication
--vsphere-password VSPHERE_PASSWORD
Password for vSphere authentication
--vm-name VM_NAME Name of the virtual machine
--pool POOL Name of the SvHCI storage pool
--remote-pool REMOTE_POOL
Name of the remote SvHCI storage pool (adds VM protection)
--warm Perform a warm import
--threshold THRESHOLD
Upper limit of remaining data to trigger cutover (warm only)
--power Power on VM after successful importExample command
Note: When importing VMs please be sure to use the VM name as ESXi or vCenter displays. VM names in vCenter can be different and will not be located thus failing to import.
Note in the below example the python client trigger machine cannot route to the VMware node on vmkernel port 192.168.1.2. However the SvHCI node can, over a back end, direct attach, network.
This enables:
- the import to occur in network with the python trigger machine perhaps being remote however the data not copying over the WAN
- the physical separation of the import to a different physical NIC so as to not impact front end production VM traffic
- potentially leveraging a faster DAC (direct attach) NIC vs a slower switch.
c:\VM-Import> python .\vm_import.py --hostname="10.10.130.3" --password="St0rMag1c!" --vsphere-hostname="192.168.1.2" --vsphere-username="root" --vsphere-password="St0rMag1c!" --vm-name="WindowsVM" --pool="pool" --warm --powerNote: Should the ESXi host password contain a $ enclose it in single quotes 'Adm1n$1.'
Example Multiple VM import
There isn't a limit to the concurrent imports.
import subprocess
vm_names = ["GuestVM01", "GuestVM02", "GuestVM03", "GuestVM04", "GuestVM05", "GuestVM06", "GuestVM07", "GuestVM08", "GuestVM09", "GuestVM10", "GuestVM11"]
base_cmd = [
"python",
r"C:\Users\Administrator\Downloads\vm_import.py",
'--hostname=10.10.130.3',
'--password=St0rMag1c!',
'--vsphere-hostname=172.16.1.1',
'--vsphere-username=root',
'--vsphere-password=St0rMag1c!',
'--pool=SvHCI01Pool',
'--remote-pool=SvHCI02Pool',
'--warm',
'--power',
]
for vm in vm_names:
cmd = base_cmd + [f'--vm-name={vm}']
subprocess.run(cmd, check=True)Example Warm VM Import Walkthrough
This is observed in SvHCI with the below task in the Virtual Machines view when an import is triggered:
Under Storage we can observe the disk importing including a percentage
With the disk selected, we can select Statistics and the throughput toggle to view the incoming write speed.
With the host selected in vCenter, Monitor>Advanced>Chart Options and Networks we can see the network copy throughput speed.
Once the majority of the data copy has completed change block tracking is then in place with snapshots being triggered on the VM.
And iterations on the task
When ready cut over the VM, by shutting down in VMware and the VM will power on in SvHCI with the task completing.
It is also possible to determine import timings from SvHCI node events.
Example Copy Speed
The copy speed will be impacted by many factors including network bandwidth, contention, storage read and write speed etc.
As an example we have observed a customer importing a 500GB VM (4x disks) over 10Gb networking in ~4hours 14minutes.
Streaming multiple VMs across may also improve import speed.
Troubleshooting
VMkernel Adapter Settings
The vmkernel adapter needs to be configured Default TCP/IP Stack per the below
Windows Additional Disks
StorMagic have observed Windows 2025 disks, other than C: (disk0) e.g. disk1 disk2 etc, come across as offline if automatically powering in SvHCI.
This can impact workloads badly, such as SQL, if looking for those disks coming online in a bad state.
This is due to the san policy within the Windows OS, however this may be different depending on the Windows OS per the below from AI:
| Windows Version | Edition | Default SAN Policy | Behaviour on New Disk |
| Server 2008 - 2025 | Enterprise / Datacenter | OfflineShared | Offline (if on a shared bus) |
| Server 2008 - 2025 | Standard | OnlineAll* | Online (*usually) |
| Windows 10 / 11 | Pro / Home / Edu | OnlineAll | Online |
| Any Version | With Hyper-V Role | OnlineAll | Online (overrides default) |
Per the below,
DISKPART> list disk
DISKPART> san
DISKPART> san policy = onlineall
DISKPART> sanprior to VM import, via DiskPart run the below to ensure disks come online automatically at first boot post import:
Windows Spanned Disks
If importing a Windows VM with a spanned disk, you will need to manually online the disks in Disk Management after completion.
See Also
https://stormagic.com/doc/svhci/2-1-0/en/Content/SvHCI/vm-import.htm
https://stormagic.com/doc/svhci/2-4-0/en/VMs/vm-import-utility.htm
Comments
0 comments
Article is closed for comments.