Die Foren-SW läuft ohne erkennbare Probleme. Sollte doch etwas nicht funktionieren, bitte gerne hier jederzeit melden und wir kümmern uns zeitnah darum. Danke!

ESXi + ZFS/OmniOS/napp-it All-IN-ONE VM

Moderatoren: irix, Dayworker

Beiträge: 45
Registriert: 19.12.2010, 18:26

Re: ESXi + ZFS/OmniOS/napp-it All-IN-ONE VM

Beitragvon gea » 25.11.2022, 20:45

All-in-One (ESXi, inkl. free + virtualisierte ZFS SAN storage appliance): Autostart der VMs von NFS

Als ich die AiO Idee vor über 10 Jahren erstmals vorstellte, ging das noch einfach. Die Storage VM starten und mit einer Verzögerung die VMs auf NFS. Mit aktuellem ESXi geht das nicht mehr. ESXi scheint die Verfügbarkeit einer VM vor der Autostart Verzögerung zu überprüfen. NFS der Storage VM steht da noch nicht bereit.

- Anlegen einer leeren Dummy VM auf dem lokalen Datastore
- Autostart der OmniOS Storage VM
- Autostart der Dummy VM mit ausreichender Startverzögerung bis OmniOS NFS bereitstellt und ESXi das automatisch verzögert mountet.
- Autostart der anderen VMs auf NFS

Beiträge: 45
Registriert: 19.12.2010, 18:26

Re: ESXi + ZFS/OmniOS/napp-it All-IN-ONE VM

Beitragvon gea » 19.02.2023, 02:18

Manage ESXi via SOAP ex create/delete ESXi Snaps

I came up with the idea of AiO (ESXi server with virtualized ZFS/NFS storage and VMs on NFS and pass-through storage hardware) around 2010. This was the first stable ZFS storage solution based on (Open)Solaris or a lightweight minimalistic OmniOS. Others copied the idea based on Free-BSD or Linux.

From the beginning ZFS snaps offered a huge advantage over ESXi snaps as they could be created/destroyed without delay and initial space consumption. Even thousands of snaps are possible while ESXi snaps are limited to a few shorttime ones. Combined with ZFS replication a high speed backup or copy/move of VMs is ultra easy. That said, there is a problem with ZFS snaps and VMs as the state of a ZFS snap is like a sudden powerloss. There is no guarantee that a VM in a ZFS snap is not corrupted.

In napp-it I included an ESXi hotsnap function to create a save ESXi snap prior the ZFS snap followed by a ESXi snap destroy. This includes an ESXi snap in every ZFS snap with hot memory state. After a VM restore from an ZFS snap you can go back to the safe ESXi snap. Works perfectly but handling is a little complicated as you need ssh access to access esxcli. Maybe you have asked yourself if there is no easier way and there is one vie the ESXi SOAP api similar to the ESXi web-ui.

Thomas just published a small interactive Perl script for easy ESXi web management via SOAP. It even works with ESXi free, see ESX / ESXi - Hilfethread

1. install (missing) Perl modules
perl -MCPAN -e shell
notest install Switch
notest install Net::SSLeay
notest install LWP
notest install LWP::protocol::https
notest install Data::Dumper
notest install YAML

complete list of needed modules:
Data:: Dumper

Update napp-it to newest 23.dev where the script is included

example: list all datastores
perl /var/web-gui/data/napp-it/zfsos/_lib/scripts/soap/VMWare_SOAP.pl list_all_datastores --host --user root --password 1234

Attached Datastores "63757dea-d2c65df0-3249-0025905dea0a"
Attached Datastores ""

example: list VMs:
perl /var/web-gui/data/napp-it/zfsos/_lib/scripts/soap/VMWare_SOAP.pl list_attached_vms --host --user root --password 1234--mountpoint /nvme/nfs --mounthost

Attached VM ID "10" = "solaris11.4cbe"
Attached VM ID "11" = "w2019.125"
Attached VM ID "12" = "oi10.2022"
Attached VM ID "14" = "w11"
Attached VM ID "15" = "ventura"
Attached VM ID "16" = "danube"
Attached VM ID "9" = "omnios.dev.117"

example: create snap
perl /var/web-gui/data/napp-it/zfsos/_lib/scripts/soap/VMWare_SOAP.pl create_snapshot --host --user root --password 1234--mountpoint /nvme/nfs --mounthost --vm_id 9 --snapname latest --mem --no-quiesce --snapdesc latest

example: list (latest) snap
perl /var/web-gui/data/napp-it/zfsos/_lib/scripts/soap/VMWare_SOAP.pl list_snapshot --host --user root --password 1234 --vm_id 9

I will use the script to work together with a normal autosnap job in a future napp-it. Up to then you can create a jobid.pre (ex 123456.pre) in /var/web-gui/_log/jobs/ with a script to create the ESXi snap and a jobid.post to destroy the ESXi snap after it was included in the ZFS snap.

Ich habe ein SOAP Menü ins neueste napp-it 23.dev eingebaut


Zurück zu „VMs & Appliances“

Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 1 Gast