Backup & Recovery

 View Only
  • 1.  Cloning a vm from command line whilst keeping the vm running

    Posted Aug 27, 2020 09:57 AM

    Hi,

    I'm trying to backup esxi vms from cli not using snapshots.

    We have several vms which run tests round the clock and so downtime needs to be limited.

    Environment is ESXi 6.7.0 and vsphere 6.7.0

    From the gui I can clone without vm downtime. I'm yet to find a way of doing this via command line so that I can automate the backups

    copying the vmdks, vmx via vmkfstools returns "device busy" errors

    I've downloaded vsphere cli and started to look at the dcli interface which seems to be the api into vsphere but I'm not sure if this can do backups.

    It seems like a fairly common thing to want to do but I've been stuck on this one for some weeks.  Any advice or ready to go scripts on how to proceed

    Thanks
    Paul



  • 2.  RE: Cloning a vm from command line whilst keeping the vm running

    Broadcom Employee
    Posted Aug 27, 2020 10:07 AM

    Wouldn't it make more sense to use PowerCLI for this, or any other language via the APIs?



  • 3.  RE: Cloning a vm from command line whilst keeping the vm running

    Posted Aug 27, 2020 12:15 PM

    I would happily use a powerCli, dcli or vsphere-cli script to do this and is exactly what I'm looking for. The trouble is I've not found a cloning script that works while the existing vm stays up



  • 4.  RE: Cloning a vm from command line whilst keeping the vm running

    Posted Aug 27, 2020 12:13 PM

    Veeam community edition will do up to 10 VMs for free.

    A quick Google for "vmware clone powershell" found this: Clone VM using Powershell PowerCLi which mentions a script that a bit of searching will find.



  • 5.  RE: Cloning a vm from command line whilst keeping the vm running

    Posted Aug 27, 2020 01:27 PM

    hey, hope you are doing fine

    have you checked this?
    Power CLI script to clone the virtual machine



  • 6.  RE: Cloning a vm from command line whilst keeping the vm running

    Posted Aug 27, 2020 02:26 PM

    Thanks for the link. I'll give that a go



  • 7.  RE: Cloning a vm from command line whilst keeping the vm running

    Posted Aug 28, 2020 06:43 AM

    Moderator: As you are trying to resolve the same issue, your follow-up question on dcli should be added to this thread rather than starting a whole new thread (which has now been archived).