Code Snippet

Just another Code Snippet site

[ESX] How-To

Connect to ESX using SSH:
create folder & file :

/etc/ssh/keys-<ESX_USERNAME>/authorized_keys

Copy/Paste the public key of the remote used.


List all VMs:

vim-cmd vmsvc/getallvms

List all snapshot for a VM :

vim-cmd vmsvc/snapshot.get <VM_ID>

Restore a snapshot :

vim-cmd vmsvc/snapshot.revert <VM_ID> <SNAPSHOT_ID> 0


2 thoughts on “[ESX] How-To

  • vim-cmd vmsvc/snapshot.create <VM_ID> "SnapshotName" "Snapshot Description" true true
    

    – Name – Name for the snapshot.
    – Description – Description of the snapshot.
    – Snapshot the virtual machine’s memory – All the memory in active use on the virtual machine is written to a memory dump file (vmsn file) that is included in the snapshot.
    – Quiesce guest file system (Needs VMware Tools installed) – The quiescing process tells the operating system to write transactions out of the memory buffers and in-memory cache to the disk so that the virtual machine can have a consistent state that can be recovered from.

  • Check Power state :

    vim-cmd vmsvc/power.getstate <vmid>
    

    Startup :

    vim-cmd vmsvc/power.on <vmid>
    

    Shutdown

    vim-cmd vmsvc/power.shutdown <vmid>
    

    Poweroff

    vim-cmd vmsvc/power.off<vmid>
    

Leave a Reply to OLIVIER COMBE Cancel reply

Your email address will not be published. Required fields are marked *