Question
How can I mount a virtual server's disk to a server directly? I need to recover files or perform other tasks.
Environment
OnApp 2.x and up
Virtual Servers running on KVM and XEN compute resources using LVM or Integrated storage
Answer
To mount a virtual server's disk:
- Get the identifier for the VS disk.
Identify the type of storage: Integrated storage or LVM (if SolidFire is used, contact their support).
Identifiers starting with onapp- tend to be an LVM data store.
- Activate the disk on the server where you want to mount the disk.
• For LVM, run the following command:
lvchange -a y /dev/onapp-xxxxxx/yyyyy
CODE
Where:
onapp-xxxx - the datastore identifier
yyyy - the disk identifier
The device /dev/onapp-xxxxxx/yyyyy
is your VS disk now.
• For Integrated Storage, run the following command:
onappstore getid
onappstore online uuid=<yyyyyyy> frontend_uuid=<server's uuid from previous command>
CODE
The device /dev/xxxxxxxx/yyyyyy
is your VS disk now.
Where:
xxxxx - the data store identifier
• For KVM compute resources, map partitions before mounting:
kpartx -a -v -p X <disk device>
CODE
4. Mount the resulting /dev/mapper/......X1
device.
5. To undo these steps, you need to umount the disk and then unmap partitions, if needed:
kpartx -d -v -p X <disk device>
CODE
6. Deactivate the disk:
• LVM:
lvchange -a n /dev/onapp-xxxxxx/yyyyyy
CODE
• Integrated Storage:
onappstore offline uuid=yyyyyy
CODE