use Storage Import via your UpCloud Control Panel<\/a>.<\/p>\n\n\n\nHTTP Import<\/strong> is used to upload files made available on a web server. This is often more convenient for uploading larger files such as storage images between cloud servers. It can also be used to upload installation media directly from the OS provider\u2019s download link.<\/p>\n\n\n\nDirect upload<\/strong> allows uploading straight from your local computer without the need for setting up a web server. This requires the use of a tool such as curl<\/tt> to run the upload and which needs to remain open until the import has finished.<\/p>\n\n\n\nHTTP Import<\/h3>\n\n\n\n
When you have a storage device ready for import, begin the upload by sending the following request. Set the UUID of your target storage device in the request and the URL of the file you want to import in the body text as shown in the example below.<\/p>\n\n\n\n
POST \/1.3\/storage\/{uuid}<\/span>\/import<\/pre>\n\n\n\n{\n \"storage_import\": {\n \"source\": \"http_import\",\n \"source_location\": \"https:\/\/user:password@example.com\/files\/system.img<\/span>\"\n }\n}<\/pre>\n\n\n\nOn successful request, you\u2019ll see a response similar to the following example. The initial state of the upload will show preparing or prepared.<\/p>\n\n\n\n
{\n \"storage_import\": {\n \"client_content_length\": 0,\n \"client_content_type\": \"\",\n \"completed\": \"\",\n \"created\": \"2020-06-23T19:13:15Z\",\n \"error_code\": \"\",\n \"error_message\": \"\",\n \"md5sum\": \"\",\n \"read_bytes\": 0,\n \"sha256sum\": \"\",\n \"source\": \"http_import\",\n \"source_location\": \"https:\/\/[REDACTED]@example.com\/files\/system.img\",\n \"state\": \"prepared\"<\/span>,\n \"uuid\": \"0747a8c1-3a34-4908-925e-9ef9a369af51\",\n \"written_bytes\": 0\n }\n}<\/pre>\n\n\n\nThe import operation will then commence granted the URL you submitted is accessible.<\/p>\n\n\n\n
Direct upload<\/h3>\n\n\n\n
To begin direct upload, use the following request to create the import task. Set the UUID of your target storage device in the request and the source as direct_upload<\/tt> like in the example underneath.<\/p>\n\n\n\nPOST \/1.3\/storage\/{uuid}<\/span>\/import<\/pre>\n\n\n\n{\n \"storage_import\": {\n \"source\": \"direct_upload\"\n }\n}<\/pre>\n\n\n\nYou will then see a response such as an example output below. The response includes the direct_upload_url<\/em> that can be used to start the upload itself.<\/p>\n\n\n\n{\n \"storage_import\": {\n \"client_content_length\": 0,\n \"client_content_type\": \"\",\n \"completed\": \"\",\n \"created\": \"2020-06-26T16:06:59Z\",\n \"error_code\": \"\",\n \"error_message\": \"\",\n \"md5sum\": \"\",\n \"read_bytes\": 0,\n \"sha256sum\": \"\",\n \"source\": \"direct_upload\",\n \"direct_upload_url\": \"https:\/\/fi-hel1.img.upcloud.com\/uploader\/session\/0747a8c1-3a34-4908-925e-9ef9a369af51<\/span>\",\n \"state\": \"prepared\",\n \"uuid\": \"0747a8c1-3a34-4908-925e-9ef9a369af51\",\n \"written_bytes\": 0\n }\n}<\/pre>\n\n\n\nYou can then import files straight from your local computer by using the direct upload method. Note that the link will expire after 10 minutes if the direct upload is not started.<\/p>\n\n\n\n
curl --data-binary @\/path\/to\/files\/system.img --fail -XPUT https:\/\/fi-hel1.img.upcloud.com\/uploader\/session\/0747a8c1-3a34-4908-925e-9ef9a369af51<\/pre>\n\n\n\nWhen using something other than raw images (for example, a gzipped image), you need to also supply the Content-Type header.<\/p>\n\n\n\n
curl -H 'Content-Type: application\/gzip' --data-binary @\/path\/to\/files\/system.img.gz --fail -XPUT https:\/\/fi-hel1.img.upcloud.com\/uploader\/session\/0747a8c1-3a34-4908-925e-9ef9a369af51<\/pre>\n\n\n\nOnce the upload has finished, you\u2019ll see an output similar to the example underneath.<\/p>\n\n\n\n
{\n \"written_bytes\":9521070080,\n \"md5sum\":\"f03d31c11136e24c10c705b7b3efc39f\",\n \"sha256sum\":\"caf3fd69c77c439f162e2ba6040e9c320c4ff0d69aad1340a514319a9264df9f\"\n}<\/pre>\n\n\n\nThat\u2019s it! The data you imported is then available on the target storage devices for you to use as you wish.<\/p>\n\n\n\n
Storage Import status<\/h2>\n\n\n\n
The import process will take time depending on the size of the file and the speed of the network connectivity. Especially system storage images are often large and require more time to upload.<\/p>\n\n\n\n
You can check the state of the process using the following request. Set the UUID of your import storage device in the request URL.<\/p>\n\n\n\n
GET \/1.3\/storage\/{uuid}<\/span>\/import<\/pre>\n\n\n\nThe response will show the current state of the importing process and the progress made in writing to the storage so far.<\/p>\n\n\n\n
{\n \"storage_import\": {\n \"client_content_length\": 10737418240,\n \"client_content_type\": \"\",\n \"completed\": \"\",\n \"created\": \"2020-06-23T19:15:57Z\",\n \"error_code\": \"\",\n \"error_message\": \"\",\n \"md5sum\": \"\",\n \"read_bytes\": 1661214003,\n \"sha256sum\": \"\",\n \"source\": \"http_import\",\n \"source_location\": \"https:\/\/[REDACTED]@example.com\/files\/system.img\",\n \"state\": \"importing\"<\/span>,\n \"uuid\": \"0734ad68-e715-4687-89c5-774d708b9515\",\n \"written_bytes\": 1661214003\n }\n}<\/pre>\n\n\n\nFeel free to check the import status again later to see how the operation is progressing.<\/p>\n\n\n\n
Cancelling Storage Import<\/h2>\n\n\n\n
When the upload is started via the Storage Import API to a stand-alone storage device, the process will continue in the background without interruption to other operations.<\/p>\n\n\n\n
However, if you wish to stop the import, you can cancel the operation using the following API request. Set the UUID of your import storage device in the request URL.<\/p>\n\n\n\n
POST \/1.3\/storage\/{uuid}<\/span>\/import\/cancel<\/pre>\n\n\n\nYou will then get a response something along the lines of the example underneath. The state of the import will first show cancelling.<\/p>\n\n\n\n
{\n \"storage_import\": {\n \"client_content_length\": 10737418240,\n \"client_content_type\": \"\",\n \"completed\": \"2020-06-23T19:19:09Z\",\n \"created\": \"2020-06-23T19:15:57Z\",\n \"error_code\": \"CLIENT_FAILURE\",\n \"error_message\": \"import task was cancelled\",\n \"md5sum\": \"6b2bfc737ef922f47ed4751d474170c6\",\n \"read_bytes\": 2494455091,\n \"sha256sum\": \"19567e0a4c83ae010c35fa094e5832e09ac20655912141138df38354ef51d030\",\n \"source\": \"http_import\",\n \"source_location\": \"https:\/\/[REDACTED]@example.com\/files\/system.img\",\n \"state\": \"cancelling\"<\/span>,\n \"uuid\": \"0734ad68-e715-4687-89c5-774d708b9515\",\n \"written_bytes\": 2494455091\n }\n}<\/pre>\n\n\n\nAfter cancelling, the storage device will return to the normal online state and again allow new storage import or other requests.<\/p>\n\n\n\n
Making use of new storage<\/h2>\n\n\n\n
Once your upload has finished, you can put the new storage device to use the way you wish.<\/p>\n\n\n\n
Storage image with a boot partition<\/h3>\n\n\n\n
If your storage image contains a boot partition, you can set it as the main device for a standalone cloud server.<\/p>\n\n\n\n
Depending on your system storage and the previous networking setup, you may not have network access out of the box. You can use the web console at your UpCloud Control Panel or any VNC viewer to reach your cloud server<\/a> to restore connectivity.<\/p>\n\n\n\nThe default network interfaces on our cloud servers include the following:<\/p>\n\n\n\n