VMware vSphere

 View Only
  • 1.  taking a snapshot via command line in vsphere

    Posted Mar 11, 2021 02:50 PM

    hi all,

    just want to know if its possible to take a snapshot of a vm via the command line when i ssh into my vsphere

    i have googled and have found you can do it via powercli but is that the only way?

    thanks,

    rob



  • 2.  RE: taking a snapshot via command line in vsphere



  • 3.  RE: taking a snapshot via command line in vsphere

    Posted Mar 15, 2021 06:10 PM

    is it best to Quiescence or not to and can i only Quiescence a vm if they have vm guest tools on the vm i want to backup?

    ok you do need to install vm tools, i installed open-vm-tools, reading from here

    https://docs.vmware.com/en/VMware-vSphere/6.7/com.vmware.vsphere.vm_admin.doc/GUID-9720B104-9875-4C2C-A878-F1C351A4F3D8.html

    do you think i need to tick  "Snapshot the virtual machine’s memory", what benefit has that got please?



  • 4.  RE: taking a snapshot via command line in vsphere

    Posted Mar 15, 2021 07:00 PM

    I guess, open-vm-tools is enough.

    If you check the “Snapshot the virtual machine’s memory” option, the snapshot will also record the VM’s memory. If you check this box and the VM is running when you take a snapshot, the icon of the snapshot will be green.

     



  • 5.  RE: taking a snapshot via command line in vsphere

    Posted Mar 15, 2021 08:43 PM

    everytime i run this command

    vim-cmd /vmsvc/snapshot.create 9 freeradiusSS quiesced

    its giving it a description of "quiesced" instead of quiescing the snapshot, what am i doing wrong?



  • 6.  RE: taking a snapshot via command line in vsphere

    Posted Mar 16, 2021 05:47 PM

    I think, nothing is wrong.

    But as a reminder:

    1. Run this command to create a new snapshot:

      vim-cmd vmsvc/snapshot.create VMID snapshotName description includeMemory quiesced

      Where includeMemory and quiesced variables are Boolean values. Set the value to 1 to enable or 0 to disable the snapshot option.

      For example:

      # vim-cmd vmsvc/snapshot.create 10 my_snapshot snapshot_test 0 0
       
    2. Run this command to remove all snapshots:

      vim-cmd vmsvc/snapshot.removeall VMID