Manage Virtual Server Disks
Virtual server storage is provided by disks. A disk is a partition of a data store that is allocated to a specific virtual server. Disks can be assigned as standard or swap disks (there are no swap disks for Windows-based templates). They can also be set as primary (that is, the disk from which an OS will boot).
Managing disks for the entire cloud is handled through the Control Panel's Settings menu. Disks for individual virtual servers are managed through the Control Panel > Cloud > Virtual Servers menu, where you can:
- Add Disks to Virtual Servers
- Edit Virtual Server Disks
- Migrate Virtual Server Disks
- Assign Disk to VS
- Delete Virtual Server Disks
Do not create multiple partitions on one disk for virtual servers. OnApp Control Panel supports only one partition per disk. In cases when you change disk partition, the CP might loose control of such a disk and the VS associated with it. If required, create additional disks instead.
Add Disks to Virtual Servers
Adding a disk to a virtual server will require that VS should be rebooted. If a VS is running when you try to add a new disk to it, you'll be asked to confirm the reboot.
To add a disk to a virtual server:
- Go to your Control Panel > Cloud > Virtual Servers menu.
- Click a VS's label to open its details screen.
- Click the Storage tab > Disks.
- Click the "+" button or the Create Disk button.
- Fill in the details:
- Specify disk label.
- Choose the data store to create a disk on from the drop-down list.
Move the slider to the right to specify the desired disk size.
Please note that support of secondary disks larger than 2 TB is limited. Certain operations might fail. This will be improved in future releases.
Move the Hot Attach slider to the right if you want to enable the hot adding of a disk. In this case, a virtual server is not stopped when the disk is added.
To run hot attach, a virtual server template should support VirtIO virtualization. The hot attach option is available only on KVM compute resources based on CentOS 6.x/7.x for virtual servers with VirtIO support.
- Move the Swap Space slider to the right if this disk is swap space.
Move the Require Format Disk slider to the right if this disk requires formatting.
Move the Mounted slider to the right if the disk should be added to Linux or FreeBSD FSTAB (for Linux/FreeBSD virtual servers).
Specify its mount point. The maximum length of a Mount Point is 256 characters. Spaces are not allowed. No more than one slash is allowed. If the mount point is not specified the default mount point will be used:
/mnt/onapp-disk-#{disk.identifier}
- Indicate the file system - ext3, ext4 or xfs - for Linux based VS.
Click the Add Disk button to finish.
Restrictions:
- If you choose a Solidfire data store, the minimum disk size will be regulated by Solidfire Data Store Zone settings.
- If virtual server and the Control Panel server belong to different networks, the hot attach transaction will fail.
- If an additional disk has been created without the Require format disk option and formatted/partitioned in another way, resize disk action may work incorrectly. Use the Require format disk option when creating an additional disk, otherwise, use disk resize option at your own risk.
- Make sure to enable Require format disk option when you add a new VS disk. Otherwise taking normal backups for your additional disk might fail.
- To be able to take incremental backups for virtual server’s disk, you must mount this disk to FSTAB (either Linux or FreeBSD) and specify the proper mount point manually.
- You cannot back up Swap disks.
- When you add a new disk to a virtual server, it automatically becomes available to that server.
Edit Virtual Server Disks
Primary and Swap disks
For primary and swap (Linux, FreeBSD) disks you can only change the label and size.
You can resize the disks when you need. The resize will fail if your current usage is greater than the new size you request. Note that any changes to the disk size will lead to a reboot of your VS.
To change the disk size:
- Go to your Control Panel > Cloud > Virtual Servers menu.
- Make sure your virtual server is powered off and click the VS label.
- Click the Storage tab > Disks.
- Click the Actions button next to the target disk and then click Edit.
- You can edit the disk label and size in GB.
- Click the Save Disk button.
- It is recommended to take a backup of a virtual server before editing the VS disk. In case of any issues during the VS disk editing, you will be able to restore the VS from the backup.
- You cannot resize a disk that uses GUID Partition Table (GPT).
- You cannot decrease the size of the Integrated Storage data store disks.
- You cannot decrease the disk size for Windows-based and FreeBSD-based virtual servers. Only the increase disk size option is available.
- You cannot resize the primary disk for FreeBSD-based virtual servers.
- Decreasing disk size for Linux-based virtual servers may lead to filesystem inconsistencies. Make sure you have current backups before proceeding.
- If the disk file system can not be detected (disk has more than one partition or some special partition table/file system), you can only increase disk physical volume size.
- If you start the disk resize and then decide to cancel it, there may be complications such as the file system corruption.
- Size of a primary disk cannot exceed 2 TB.
New disks
For new disks - those which were added after the virtual server was created - you can edit the following:
Linux | Windows | FreeBSD |
---|---|---|
|
|
|
|
|
|
|
|
|
|
| |
|
| |
|
Migrate Virtual Server Disks
OnApp allows hot and cold migration of virtual server disks:
- Hot migration - the migration of disks between compute resources that share common data stores (or data store zones)
- Cold migration - the migration of disks between compute resources with local storage or across compute zones
You can migrate disks of your virtual servers to other data stores, which are allocated to the same Compute resource. Unlike VS migration, disk cold migration requires the reboot of the VS (despite the template it is based on).
- The hot migration will work only when the VS is running on CentOs 7 KVM compute resources, and they can be migrated only to CentOs 7 KVM compute resources.
- The hot migration option appears only if the VS is online and your Quick Emulator (QEMU) version is later than 2.6
To migrate a disk:
- Go to your Control Panel > Cloud > Virtual Servers menu.
- Click the label of your virtual server to open its details screen.
- Click the Storage tab > Disks.
- Click the Actions button next to the disk you want to move to another data store, then click the Migrate button.
On the screen that appears, select the following options:
Type - select the cold or hot migration type
Data store - select the target data store to migrate the disk
- Click the Start Migrate button.
- It is recommended to take a backup of a virtual server before migrating the VS disk. In case of any issues during VS disk migration, you will be able to restore the VS from the backup.
- You can only migrate disks to data stores in data store zones assigned to your bucket.
- You cannot migrate a disk to a data store with less capacity than the disk size.
- Integrated Storage disks cannot be migrated if they have snapshots.
- If you move an 850GB disk between aggregates with 10GB actual usage, the 'dd' image of the local volume manager will take 850GB space, because the entire local volume manager is copied, including zero 'dspace which may not be able to be recovered.
- If required, you can change the block size which is used during disk migration at Control Panel > Admin > Settings > Configuration by editing the Block Size (MB) parameter.
Assign Disk to VS
You can temporarily assign a disk to another virtual server that has the same data store in use. The disk will be attached to the target VS, but it is necessary to reboot the target VS and mount the disk manually to make it available. Later you can re-assign the disk back to the primary VS at any appropriate moment.
- Ensure that the Assign any disk to VS/Assign own disk to VS permissions are on before assigning disk to another VS. For more information refer to the List of all OnApp Permissions section of this guide.
- Assigning disk functionality is not applicable for swap disks.
The target VS owner should be the same as for the source VS.
Both target and source VSs cannot be deleted as soon as the disk is assigned to a new VS. To delete target and source VSs, as well as the disk, it is required to re-assign a disk to a source VS.
- Note that source VS cannot be started when any of its disk is being attached to another VS.
To assign a disk to another VS:
- Go to your Control Panel > Cloud > Virtual Servers menu.
- Click the label of a virtual server to open its details screen.
- Click the Storage tab > Disks.
- Click the Actions button next to the disk you want to assign to another VS, then click the Assign to VS button.
On the screen that appears, select a target VS from a drop-down box.
Click Assign.
Be aware, that the source VS will be automatically powered off after assigning a disk to another VS.
To re-assign the disk back to the primary VS:
- Go to your Control Panel > Cloud > Virtual Servers menu.
- Click the label of a virtual server to open its details screen.
- Click the Storage tab > Disks.
Click the Actions button next to the disk you want to reassign to source VS, then click the Assign back button. Confirm the action.
If the target VS is running on XEN compute resource, it will be automatically powered off after re-assigning a disk back to the source VS.
Delete Virtual Server Disks
To delete a disk:
- Go to your Control Panel > Cloud > Virtual Servers menu.
- Make sure your virtual server is powered off, then click its label to open its details screen.
- Click the Storage > Disks tab.
- Click the Actions button next to the disk you want to delete, then click Delete.
- In the pop-up window, move the Force Reboot slider to the right, then select the VS shutdown type.
Move the Required Startup slider to the right to start up the VS automatically after the network is rebuilt.
Steps 5 and 6 apply to disks of VSs that are on.
Click the Destroy Disk button.
This will schedule the "destroy disk" transaction.
Clean Virtual Server Disks
OnApp Cloud provides two ways to clean VS data when deleting or migrating a VS's disk. By default, OnApp Cloud will format the physical disk space used by a virtual server when that VS's virtual disk is deleted, or when the VS disk is migrated to another data store.
You can also choose to zero out a VS's disk (filling it with zeroes) with the change detailed below which will then take effect for operations queued both via the UI as well as the API.This method will likely have a noticeable impact on deletion times and the load placed on the data store, whilst disks are being filled with zeros as it is a far more IO intensive operation.
We recommend enabling zeroing out disks in your cloud.
To enable this behaviour:
- Log in via SSH to your Control Panel server.
Open the following configuration file for editing:
/onapp/interface/config/on_app.yml
Set the wipe_out_disk_on_destroy parameter from false to true:
wipe_out_disk_on_destroy: true
If this option is not enabled, it may be possible to use data recovery techniques to restore files from a previously deleted disk.
Restart the OnApp service:
service onapp restart
Now when deleting disks you would see something along the lines of the following in the logs:
Running: dd if=/dev/zero of=/dev/onapp-cmd7y65etpxii8/hkct05vbu21fma bs=4M count=256 conv=notrunc oflag=direct