Creating a Windows Server VM with a connection to Cloud Backup
You can back up Compute Cloud VMs with supported Windows-based operating systems.
For the Cloud Backup agent to run properly, VMs must meet the minimum requirements.
Getting started
Creating a VM
-
In the management console
, select the folder where you want to create a VM. -
In the list of services, select Compute Cloud.
-
In the left-hand panel, select
Virtual machines and click Create virtual machine. -
Under General information:
-
Enter a name and description for the VM. The naming requirements are as follows:
- The name must be from 3 to 63 characters long.
- It may contain lowercase Latin letters, numbers, and hyphens.
- The first character must be a letter and the last character cannot be a hyphen.
Note
The VM name is used to generate an internal FQDN only once: when creating a VM. If the internal FQDN is important to you, choose an appropriate name for the VM at the creation stage.
-
Select an availability zone to place your VM in.
-
-
Under Boot disk image, select an operating system supported in Cloud Backup.
-
Under Network settings:
- Choose a subnet in the selected availability zone.
- In the Public IP field, select
Auto
. - Select a security group configured to work with Cloud Backup.
-
Under Access, select the service account with the
backup.editor
role. -
Under Additional:
- Enable Cloud Backup.
- Optionally, select a backup policy or click Create to create a new one.
-
Specify the other VM parameters as needed.
-
Click Create VM.
-
Select a folder:
yc resource-manager folder list
Result:
+----------------------+--------------------+------------------+--------+ | ID | NAME | LABELS | STATUS | +----------------------+--------------------+------------------+--------+ | wasdcjs6be29******** | my-folder | | ACTIVE | | qwertys6be29******** | default | | ACTIVE | +----------------------+--------------------+------------------+--------+
-
Select a subnet:
yc vpc subnet list --folder-id <folder_ID>
Result:
+----------------------+---------------------------+----------------------+----------------+-------------------+-----------------+ | ID | NAME | NETWORK ID | ROUTE TABLE ID | ZONE | RANGE | +----------------------+---------------------------+----------------------+----------------+-------------------+-----------------+ | b0c6n43f9lgh******** | default-ru-central1-d | enpe3m3fa00u******** | | ru-central1-d | [10.***.0.0/24] | | e2l2da8a20b3******** | default-ru-central1-b | enpe3m3fa00u******** | | ru-central1-b | [10.***.0.0/24] | | e9bnlm18l70a******** | default-ru-central1-a | enpe3m3fa00u******** | | ru-central1-a | [10.***.0.0/24] | +----------------------+---------------------------+----------------------+----------------+-------------------+-----------------+
-
Create the
init.ps1
file with a script for installing the Cloud Backup agent on your VM:#ps1_sysnative echo 'Starting to execute backup agent installation' Invoke-WebRequest https://storage.yandexcloud.net/backup-distributions/agent_installer.ps1 -UseBasicParsing | Invoke-Expression
-
Create a VM:
yc compute instance create \ --folder-id <folder_ID> \ --name <VM_name> \ --zone <availability_zone> \ --network-interface subnet-name=<subnet_name>,nat-ip-version=ipv4,security-group-ids=<security_group_ID> \ --create-boot-disk image-id=<image_ID>,size=<boot_disk_size> \ --cores 2 \ --core-fraction 100 \ --memory 4 \ --service-account-name <service_account_name> \ --metadata-from-file user-data=<path_to_file_with_script>
Where:
-
--name
: VM name.Note
The VM name is used to generate an internal FQDN only once: when creating a VM. If the internal FQDN is important to you, choose an appropriate name for the VM at the creation stage.
-
--zone
: Availability zone matching the selected subnet. -
subnet-name
: Name of the selected subnet. -
security-group-ids
: ID of the security group configured to work with Cloud Backup. -
image-id
: OS image ID. See the list of supported Windows-based operating systems. -
create-boot-disk
: Boot disk size. -
--cores
: Number of vCPUs in the VM. -
--core-fraction
: Guaranteed vCPU share in %. -
--memory
: VM RAM size. -
--service-account-name
: Name of the service account with thebackup.editor
role. -
--user-data
: Path to the previously created file with a script for installing the Cloud Backup agent on your VM.
In this example, we are creating a VM running Windows Server 2022:
yc compute instance create \ --name my-vm \ --zone ru-central1-b \ --network-interface subnet-name=my-vpc-ru-central1-b,nat-ip-version=ipv4,security-group-ids=abcd3570sbqg******** \ --create-boot-disk image-id=fd890bh2sapn********,size=60 \ --cores 2 \ --core-fraction 100 \ --memory 4 \ --service-account-name backup-editor \ --metadata-from-file user-data=init.ps1
Result:
done (46s) id: abcdho6nspdk******** folder_id: wasdcjs6be29******** created_at: "2023-10-09T14:57:06Z" name: my-vm ... placement_policy: {}
-
When the VM switches to the Running
status, the Cloud Backup agent will start installing on it. This may take from 10 to 30 minutes.
Note
If the Cloud Backup agent fails to install within 30 minutes, contact
Once you install the agent, the VM will be added to Cloud Backup in the