Skip to main content

Virtualization

warning

This API is not documented yet.

Overview​

API wrapper for Synology Virtual Machine Manager.

Provides methods to manage tasks, networks, storage, hosts, VMs, and images.

Parameters​

ip_address str
IP address of the Synology NAS.

port str
Port number to connect to.

username str
DSM username.

password str
DSM password.

secure bool
Use HTTPS if True. Default is False.

cert_verify bool
Verify SSL certificate if True. Default is False.

dsm_version int
DSM version. Default is 7.

debug bool
Enable debug mode. Default is True.

otp_code str
One-time password for 2FA, if required.

Methods​

get_task_list​

Get the list of virtualization tasks.

Internal API​

SYNO.Virtualization.API.Task.Info

Returns​

list of str
List of task IDs.


clear_task​

Clear a specific task by its ID.

Internal API​

SYNO.Virtualization.API.Task.Info

Parameters​

taskid str
Task ID to clear.

Returns​

dict[str, object] or str
Result of the clear operation or error message.


get_task_info​

Get information about a specific task.

Internal API​

SYNO.Virtualization.API.Task.Info

Parameters​

taskid str
Task ID to retrieve information for.

Returns​

dict[str, object] or str
Task information or error message.


get_network_group_list​

Get the list of network groups.

Internal API​

SYNO.Virtualization.API.Network

Returns​

list of dict
List of network group information.


get_storage_operation​

Get the list of storage operations.

Internal API​

SYNO.Virtualization.API.Storage

Returns​

list of str
List of storage operation information.


get_host_operation​

Get the list of host operations.

Internal API​

SYNO.Virtualization.API.Host

Returns​

list of str
List of host operation information.


get_vm_operation​

Get the list of virtual machines.

Internal API​

SYNO.Virtualization.API.Guest

Parameters​

additional bool
Whether to include additional information. Default is False.

Returns​

list of dict
List of VM information.


get_specific_vm_info​

Get information about a specific virtual machine.

Internal API​

SYNO.Virtualization.API.Guest

Parameters​

additional str or list of str
Additional fields to include.

guest_id str
Guest VM ID.

guest_name str
Guest VM name.

Returns​

dict[str, object] or str
VM information or error message.


set_vm_property​

Set properties for a virtual machine.

Internal API​

SYNO.Virtualization.API.Guest

Parameters​

guest_id str
Guest VM ID.

guest_name str
Guest VM name.

autorun int
Autorun setting (0: off, 1: last state, 2: on).

description str
VM description.

new_guest_name str
New VM name.

vcpu_num int
Number of virtual CPUs.

vram_size int
RAM size in MB.

Returns​

dict[str, object] or str
Result of the set operation or error message.


delete_vm​

Delete a virtual machine.

Internal API​

SYNO.Virtualization.API.Guest

Parameters​

guest_id str
Guest VM ID.

guest_name str
Guest VM name.

Returns​

dict[str, object] or str
Result of the delete operation or error message.


vm_power_on​

Power on a virtual machine.

Internal API​

SYNO.Virtualization.API.Guest.Action

Parameters​

guest_id str
Guest VM ID.

guest_name str
Guest VM name.

host_id str
Host ID.

host_name str
Host name.

Returns​

dict[str, object] or str
Result of the power on operation or error message.


vm_force_power_off​

Force power off a virtual machine.

Internal API​

SYNO.Virtualization.API.Guest.Action

Parameters​

guest_id str
Guest VM ID.

guest_name str
Guest VM name.

Returns​

dict[str, object] or str
Result of the power off operation or error message.


vm_shut_down​

Shut down a virtual machine.

Internal API​

SYNO.Virtualization.API.Guest.Action

Parameters​

guest_id str
Guest VM ID.

guest_name str
Guest VM name.

Returns​

dict[str, object] or str
Result of the shutdown operation or error message.


get_images_list​

Get the list of VM images.

Internal API​

SYNO.Virtualization.API.Guest.Image

Returns​

dict[str, object]
Dictionary containing image information.


delete_image​

Delete a VM image.

Internal API​

SYNO.Virtualization.API.Guest.Image

Parameters​

image_id str
Image ID.

image_name str
Image name.

Returns​

dict[str, object] or str
Result of the delete operation or error message.


create_image​

Create a new VM image.

Internal API​

SYNO.Virtualization.API.Guest.Image

Parameters​

auto_clean_task bool
Whether to auto-clean the task after creation. Default is True.

storage_names str
Storage names.

storage_ids str
Storage IDs.

type str
Image type ('disk', 'vdsm', or 'iso').

ds_file_path str
File path (should begin with a shared folder).

image_name str
Name of the image.

Returns​

dict[str, object] or str
Result of the create operation or error message.