Articles in this section

How to move VPS from one storage to another within one CR?

Applicable to:

  • SolusVM 2

Question

How to move VPS from one storage to another within one CR?

Answer

  1. Note the VPS UUID and Stop the VPS in SolusVM 2
  2. Create a logical volume of the same disk space on the second storage:

    # lvcreate -L 10G -n 1 /dev/storage2

  3. Copy the original VPS LVM image into the created one:

    # dd if=/dev/storage1/1 | dd of=/dev/storage2/1 bs=8192

  4. Open the VPS config for editing using UUID from step 1:

    # virsh edit UUID

  5. Find the line with the VPS LVM image:

    CONFIG_TEXT: source file='/dev/storage1/1'/>
    and change the source file path to the new one:
    <source file='/dev/storage2/1'/>

  6. Connect to SolusVM 2 management node via SSH
  7. Create the database backup:
    How-to-create-SolusVM-2-database-backup 
  8. Connect to database:
    How-to-access-SolusVM-2-database
  9. Update the storage ID for the VPS:

    # update compute_resource_vms set storage_id=NEW_STORAGE_ID where id=VPS_ID;


    Replace "NEW_STORAGE_ID" and "VPS_ID" correspondingly.

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.