Skip to main content

How to import volumes

Import volumes in AtomOS

Folder Structure:

.
└── elemento-imports
    ├── qcow2
    ├── raw
    ├── vdi
    ├── vhdx
    └── vmdk
  • Place your QEMU-compatible volumes (in .qcow2 format) in the /mnt/elemento-imports/qcow2 folder.
  • Place your "raw" images in the /mnt/elemento-imports/raw folder (verify with qemu-img info).
  • Place your VirtualBox images (.vdi format) in the /mnt/elemento-imports/vdi folder.
  • Place your Hyper-V or Windows exported images in the /mnt/elemento-imports/vhdx folder.
  • Place your VMware images in the /mnt/elemento-imports/vmdk folder.

How-To:

via API-call:

To import a disk you need to call the import API from the storage client: http://127.0.0.1:27777/api/v1.0/client/volume/import

{
  "name": "<your-volume-name>",
  "ip": "<server ip>",
  "bootable": true,
  "readonly": true,
  "shareable": true,
  "private": true,
  "clonable": true,
  "bus": "sata",
  "alg": "rsync",
  "overlay": true,
  "import_path": "<volume path>",
  "benchmark": {
    "read_MB_bw": 0,
    "write_MB_bw": 0,
    "read_iops": 0,
    "write_iops": 0
  },
  "hw_device": null,
  "fs": null,
  "kind": null
}

where:

  • <your-volume-name> : The name of the Elemento volume.
  • <server ip> : The IP address of the server where the volume to be imported is located.
  • <volume path> : The file path on the server where the volume to be imported is located.
Notes

overlay: The overlay option must be true if you are importing a vmdk, vdi, or vhdx image. If you are importing a raw or qcow2 file, overlay must be false.

compact: When a volume is imported, the backing file is linked to the new vault until the first.unexport. After the first unexport (when the disk resides entirely on the new volume), you can call the compact endpoint: http://127.0.0.1:27777/api/v1.0/client/volume/overlay/compact

{
  "volume_id": "fffffffffffffffffffffffffff"
}

Provide the volume ID of the volume you are trying to compact. This will merge the backing file with the overlay and create a new qcow2 image (classic conversion).

Note: This process might take quite some time depending on the size of the backing file.