This article is intended for administrators wishing to utilize SvHCI 2.1.0 to import VMware Virtual Machines across into SvHCI
Note: All images are clickable for enlarging, or can be opened in a new tab
Resolution/Information
Note: StorMagic VM import is a cold import. e.g. the Guest virtual machine will need to be powered off
Table of Contents
- Summary
- Windows VM import
- Trigger box Configuration and setup
- Command Parameters
- Help Syntax
- Example Command
- Example Iterative VM Import
- Example Copy Speed
Summary
The StorMagic SvHCI VM import utility essentially 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 talking 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.
Note: The import utility script is included in both SvHCI firmware image and ISO download packages alongside being attached to this KB
Windows VM import
To ensure Windows VMs import correctly please ensure they're booting 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 on - UEFI, LSI Logic SAS, E1000E (server 2016 template)
Base system installed - UEFI, LSI SAS, E1000E (server 2016 template)
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.
Export to OVF, or pull the VMDK via datastore browser, or import via StorMagic SvHCI 2.1.0 import utility.
Trigger box Configuration and setup
Download and install python to your operating system of choice. The below demo's running on Windows.
Ensure to select the highlighted py launcher
Ensure to add Python to the environment variables
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 |
Help syntax
PS C:\Users\markc\Desktop\vm-import python .\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]
Script to process VM import operation with vCenter / vSphere host.
options:
-h, --help show this help message and exit
--defaults DEFAULTS Path to defaults file (key=value per line)
--hostname HOSTNAME Hostname of the target system
--password PASSWORD Password for authentication
--vsphere-hostname VSPHERE_HOSTNAME
vSphere server address
--vsphere-username VSPHERE_USERNAME
Password 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 pool on the local system
--remote-pool REMOTE_POOL
Name of the storage pool on the remote system (adds VM protection)
PS C:\Users\markc\Desktop\vm-import
Example command
Note in the below example the python client cannot route to the VMware node on vmkernel port 192.168.1.2. However the SvHCI node can, over a back end network.
PS C:\> python C:\Users\markc\Desktop\vm-import\vm_import.py --vsphere-hostname="192.168.1.2" --vsphere-username="root" --vsphere-password="St0rMag1c!" --hostname="10.10.130.3" --password="St0rMag1c!" --pool="pool" --vm-name="WindowsVM"
Note: The vmkernel adapter needs to be configured Default TCP/IP Stack per the below
Example Iterative VM import
vm_list = ['GuestVM1', 'GuestVM2', 'GuestVM3', 'GuestVM4', 'GuestVM5']
for vm in vm_list
python C:\Users\markc\Desktop\vm-import\vm_import.py --vsphere-hostname="192.168.1.2" --vsphere-username="root" --vsphere-password="St0rMag1c!" --hostname="10.10.130.3" --password="St0rMag1c!" --pool="pool" --vm-name=(vm)
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.
The system will run 10x imports concurrently. e.g. with a vm_list of 11 VMs, 10 will stream across, and GuestVM11 will start when 1x out of the 10 finishes.
Streaming multiple VMs across may also improve import speed
See Also
https://stormagic.com/doc/svhci/2-1-0/en/Content/SvHCI/vm-import.htm
Comments
0 comments
Article is closed for comments.