Copied the specified VM, making a new VM. Unlike clone, copy does not exploits the capabilities of the underlying storage repository in which the VM's disk images are stored. Instead, copy guarantees that the disk images of the newly created VM will be 'full disks' - i.e. not part of a CoW chain. This function can only be called when the VM is in the Halted State.
| Return value | ||
| type | description | |
| VM | The reference of the newly created VM. | |
| Parameters | ||
| name | type | description |
| session_id | session | valid session reference |
| vm | VM | The VM to be copied |
| new_name | string | The name of the copied VM |
| sr | SR | An SR to copy all the VM's disks into (if an invalid reference then it uses the existing SRs) |
| Errors | ||
| name | arguments | description |
| VM_BAD_POWER_STATE | vm, expected, actual | You attempted an operation on a VM that was not in an appropriate power state at the time; for example, you attempted to start a VM that was already running. The parameters returned are the VM's handle, and the expected and actual VM state at the time of the call. |
| SR_FULL | requested, maximum | The SR is full. Requested new size exceeds the maximum size |
| OPERATION_NOT_ALLOWED | reason | You attempted an operation that was not allowed. |
- Message has both a synchronous and asynchronous version
- This is a custom message