Disk images can be imported from external URLs to be used as source images for root or additional disks for Virtual Servers. In addition to qcow2, raw and iso formatted images are also supported, and may be compressed with either gz or xz.
Most Operating Systems and virtual appliances provide a Cloud image in qcow2 or raw format. These are all compatible, and may be used while following this guide.
Note
Using a .iso installation media (ie., a virtual DVD) requires additional parameters not covered in this document. For assistance, please contact your CoreWeave Support Specialist.
There are three ways to import disk images from external sources:
A DataVolume is used to both do the import and store the imported image.
Use the following manifest to import a disk image already hosted on a publicly accessible HTTP/HTTPS Web server:
apiVersion:cdi.kubevirt.io/v1beta1kind:DataVolumemetadata:name:debian-importspec:source:http:url:"http://download.cirros-cloud.net/0.5.2/cirros-0.5.2-x86_64-disk.img"pvc:accessModes: - ReadWriteOncevolumeMode:BlockstorageClassName:block-nvme-ord1# Update to region where your VS will runresources:requests:storage:64Mi# Update to size of imported image
Using an external object store
A DataVolume can also import a disk image from an S3-compatible object store. To import an image from an existing object store, create a Secret with your accessKey and secretKey:
The Secret - along with your object store URL - will be referenced in your manifest:
apiVersion:cdi.kubevirt.io/v1beta1kind:DataVolumemetadata:name:debian-importspec:source:s3:url:https://object-store-tld/bucket-name/cirros-0.5.2-x86_64-disk.imgsecretRef:object-import-secretpvc:accessModes: - ReadWriteOncevolumeMode:BlockstorageClassName:block-nvme-ord1# Update to region where your VS will runresources:requests:storage:64Mi# Update to size of imported image
Using CoreWeave Object Storage
An image stored locally can easily be uploaded to CoreWeave Object Storage, then imported to a DataVolume.
The updated secret will be referenced in your DataVolume manifest.
Note
The path-mapping for the Object Store URL uses sub-path mapping.
apiVersion:cdi.kubevirt.io/v1beta1kind:DataVolumemetadata:name:debian-importspec:source:s3:url:https://object.lga1.coreweave.com/images/cirros-0.5.2-x86_64-disk.imgsecretRef:object-import-secretpvc:accessModes: - ReadWriteOncevolumeMode:BlockstorageClassName:block-nvme-ord1# Update to region where your VS will runresources:requests:storage:64Mi# Update to size of imported image
The status of the import can be followed by using kubectl get --watch while it is importing:
$ kubectl get --watch dv debian-import
NAME PHASE PROGRESS RESTARTS AGE
debian-import Pending N/A 4s
debian-import ImportScheduled N/A 7s
debian-import ImportInProgress N/A 19s
debian-import ImportInProgress 0.00% 22s
debian-import ImportInProgress 1.00% 29s
debian-import ImportInProgress 7.12% 58s
...
debian-import Succeeded 100.0% 11m
If the counter in the "RESTARTS" column increases, it means there has been an error while trying to import the image. Use kubectl describe dv to see the error:
$kubectldescribedvdebian-import...Events:TypeReasonAgeFromMessage------------------------- Warning ErrResourceExists 41s (x8 over 49s) datavolume-controller Resource "debian-import" already exists and is not managed by DataVolume
NormalPending40sdatavolume-controllerPVCdebian-importPendingNormalImportScheduled38sdatavolume-controllerImportintodebian-importscheduledNormalBound38sdatavolume-controllerPVCdebian-importBoundNormalImportInProgress14sdatavolume-controllerImportintodebian-importinprogress Warning Error 6s (x2 over 11s) datavolume-controller Unable to process data: Virtual image size 2147483648 is larger than available size 576716800 (PVC size 2147483648, reserved overhead 0.000000%). A larger PVC is required.
Note
Images are fully validated after import, which makes the import process slow. Import times will be decreased in the future.
Launch a Virtual Server
After the image is finished importing, a Virtual Server can be launched with the imported image as the template for the root disk the same way they are launched using CoreWeave provided OS images.
Use the Kubectl method of deployment to create a Virtual Server manifest that specifies the source of the root disk:
apiVersion:virtualservers.coreweave.com/v1alpha1kind:VirtualServermetadata:name:example-vsspec:region:ORD1os:type:linuxenableUEFIBoot:falseresources:cpu:# Reference CPU instance label selectors here:# https://docs.coreweave.com/coreweave-kubernetes/node-typestype:amd-epyc-romecount:4memory:16Gistorage:root:size:40Gi# Root disk will automatically be expandedstorageClassName:block-nvme-ord1# Needs to match the class of the imported volumesource:pvc:namespace:tenant-test-test# Replace with your namespacename:debian-import# If the image supports cloudInit, the regular users configuration can be used# users:# - username: SET YOUR USERNAME HERE# password: SET YOUR PASSWORD HERE # To use key-based authentication replace and uncomment ssh-rsa below with your public ssh key# sshpublickey: |# ssh-rsa AAAAB3NzaC1yc2EAAAA ... user@hostnamenetwork:public:truetcp:ports: - 22
Note
When importing an image configured for EFI boot, set spec.os.enableUEFIBoot to true.
The Virtual Server will now initialize. Once fully launched and in VirtualServerReady status, it will be available over SSH (assuming the root disk image has supported SSH) as well as via regular remote console.