[Yandex Cloud documentation](../../index.md) > [Yandex Cloud Backup](../index.md) > [Step-by-step guides](index.md) > VM in Cloud Backup > Reconnecting a Linux VM with OS Login to Cloud Backup

# Reconnecting a Linux VM with OS Login to Cloud Backup

{% note info %}

If you have [deleted](delete-vm.md) a VM from Cloud Backup and want to reconnect it, use these tutorials:

* [Connecting a Linux VM](connect-vm-linux.md)
* [Connecting a Linux VM with OS Login](connect-vm-oslogin-linux.md)

{% endnote %}

{% note warning %}

When reconnecting, the VM is added to Cloud Backup as a new resource. Backups of the new VM are stored as per the linked [backup policy](../concepts/policy.md#retention).

The backup policy rules do not apply to the old VM's backups. Their storage is subject to the [pricing policy](../pricing.md#backups). If you do not need those backups, [delete](backup-vm/delete.md) them manually or use [bulk delete](backup-vm/batch-delete.md).

{% endnote %}

After [restoring a VM from a backup of another VM](backup-vm/non-native-recovery.md), the source VM the backup was created from becomes outdated.

To avoid conflicts between the two VMs when making backups, update the outdated VM's connection to Cloud Backup:

1. Reconnect to Cloud Backup from the outdated VM:

   {% list tabs group=instructions %}

   - Yandex Cloud CLI {#cli}

     1. If you do not have the Yandex Cloud CLI yet, [install and initialize it](../../cli/quickstart.md#install).
     1. See the description of the CLI command to reinstall the [Cloud Backup agent](../concepts/agent.md):

        ```bash
        yc backup agent reinstall --help
        ```

     1. Run this command:

        ```bash
        yc backup agent reinstall \
          --id <VM_ID>
        ```

        Where `id` is the unique ID of the VM. This is a required setting.

        Once you execute the command, you will get the Cloud Backup agent re-installation warning: `This command will launch commands on specified instance to reinstall backup agent via oslogin. Do you confirm this actions to be executed? [Yes/no][y/N]`. Confirm the reinstallation: in the terminal, type `yes` and press `Enter`. The Cloud Backup agent reinstallation will start. It will take some time.

        Result:

        ```text
        ...
        Deleting old resource bound for instance_id epdoe4g6dbq4******** and resource_id: F07543A1-BDC1-415A-A143-C18E********
        Updating ids in Cloud Backup
        Finished
        ```

     1. Optionally, run this command to view Cloud Backup agent installation logs:

        ```bash
        yc backup agent debug-info \
          --id <VM_ID>
        ```

   {% endlist %}

1. Make sure the outdated VM is no longer on the list of VMs connected to Cloud Backup:

   {% list tabs group=instructions %}

   - Management console {#console}

     1. In the [management console](https://console.yandex.cloud), select the folder where Cloud Backup is connected.
     1. Navigate to **Cloud Backup**.
     1. On ![machines](../../_assets/console-icons/server.svg) **Virtual machines** tab, check that the outdated VM is not listed with the ![irrelevant](../../_assets/console-icons/circle-info-fill.svg) label.

        If the VM is still there, click ![image](../../_assets/console-icons/ellipsis.svg), select **Delete** and confirm deletion.

   {% endlist %}

1. [Link](policy-vm/attach-and-detach-vm.md) your VM to a backup policy.