Harvester vm-import-tool help

Joined
Jul 18, 2018
Messages
43
I can't for the life of me parse what to do to make this work. I'm been an esxi admin for many years so that is very familiar to me, but I have not ever used Harvester or OpenShift style hypervisors (I have dabbled with ProxMox). Anyway, I'm trying to determine if I want to migrate to Harvester or not in my homelab. All my Linux instances are OpenSUSE so I figured I'd look at this product. I want to try and migrate a few low key VM's I have running in esxi to Harvester but the documentation on using the vm-import-tool really just says to install the plug-in which creates 2 CRD files but doesn't tell you where they were created, the names, or what to do with them. Been exhausting my Google-fu trying to figure it out. Any hints to point me in the right direction are appreciated.

I've built VM's on it without issue, just need to nail down migration.
 
In case anyone is wondering, I've started to get it figured out through some kubevirt stuff. Here's what I had to do:

1. Log into the harvester node as 'harvester'.
2. sudo -i to get root access.
3. Create a vsphere-clustersetup.yaml file. I had to track down what the default Data Center name would be on a single esxi host that wasn't running vCenter. For posterity, that name is "ha-datacenter".
Code:
apiVersion: migration.harvesterhci.io/v1beta1
kind: vmwaresource
metadata:
  name: <esxihostname>
  namespace: default
spec:
  endpoint: "https://<IP or hostname>/sdk"
  dc: "ha-datacenter"
  credentials:
    name: vsphere-credentials
    namespace: default
4. Create a vsphere-secrets.yaml or add it via the Harvester web interface under the secrets menu. If you do it via the UI, just name it 'vsphere-credentials' and add 2 keys: username and password. It'll obscure the info once created.
Code:
apiVersion: v1
kind: Secret
metadata:
  name: vsphere-credentials
  namespace: default
stringData:
  "username": "<admin user such as root>"
  "password": "<pw>"
4. Run 'kubectl create -f vsphere-secrets.yaml' if you are doing it via cli
5. Run 'kubectl create -f vsphere-clustersetup.yaml'
6. Run 'kubectl get vmwaresource.migration'. You should see "clusterReady" if everything went right. This means it's ready to start migrations.

If you mess up and need to delete the resource - 'kubectl delete vmwareresource.migration <name from name field in vsphere-clustersetup.yaml>

You can name these yaml files whatever you want to, they don't matter.

I'm still creating the yaml files to do the actual migrations but this is a great step forward for me on this. In all reality it would have been faster to just do the forklift using QEMU myself than figure this out. :ROFLMAO:
 
Well, after much banging my head on the wall, this doesn't work for stand-alone esxi at this point. It requires the vCenter appliance as standalone doesn't support the functions that the import tool uses to export the VM. I've reverted to just manually exporting the VM and using qemu-img on one of my openSUSE VM's to do the conversion. Have to load up the image in Havester and then create a new VM with that image using SATA for the disk that the image is attached to vs VirtIO or SCSI (this is true of Windows or Linux VM's). Once it's up and the VirtIO drivers are installed then can reboot and then do a shutdown to change disk to VirtIO. EFI boot seems to work correctly with my Windows VM's which is good.
 
Well, after much banging my head on the wall, this doesn't work for stand-alone esxi at this point. It requires the vCenter appliance as standalone doesn't support the functions that the import tool uses to export the VM. I've reverted to just manually exporting the VM and using qemu-img on one of my openSUSE VM's to do the conversion. Have to load up the image in Havester and then create a new VM with that image using SATA for the disk that the image is attached to vs VirtIO or SCSI (this is true of Windows or Linux VM's). Once it's up and the VirtIO drivers are installed then can reboot and then do a shutdown to change disk to VirtIO. EFI boot seems to work correctly with my Windows VM's which is good.
vcenter has a 60 day trial license. That should be sufficient for what you need to do.
 
Back
Top