如何下載Rackspace雲端伺服器中儲存的圖片?

如何下載Rackspace雲端伺服器中儲存的圖片?

我想知道是否有人知道如何下載 Rackspace 雲端伺服器中儲存的伺服器映像。我一直在搜索,甚至在 Rackspace 知識庫中也沒有找到任何資訊。我知道它儲存在檔案系統中,但它到底在哪裡?

如果我從伺服器下載映像,我可以節省磁碟空間,如果有一天(我希望永遠不會)我真的需要從映像恢復,我可以輕鬆地將映像上傳回來。但Rackspace中的這些資訊是如此晦澀難懂。我只是不想開票/支援只問這個問題,我希望其他人也遇到同樣的問題並幫助我。

我使用的是centOS 6.4,任何幫助我都會非常感激。我的意思是,如果你們知道圖像儲存在檔案系統中的位置,這就是我需要知道的。

乾杯! ;)

答案1

目前還沒有辦法下載伺服器鏡像。

你現在能做的是建立您的伺服器的映像(它被儲存在儲存的影像部分),然後從那裡恢復圖像。這不是你所要求的,但這是目前的限制。

圖像儲存是 OpenStack 專案的一部分,稱為一覽和 OpenStack Swift(實際上它們儲存到 CloudFiles)。雖然此功能存在,但 Rackspace 目前尚未公開/實作。

答案2

步驟1,在rackspace雲端控制面板中的儲存>檔案下建立一個名為「export」的容器。

第2步,自訂此腳本並在任何 UNIX 機器上運行它或者閱讀下面的文檔以查看其他方法。

#!/bin/bash
sudo apt-get install python-dev gcc python-pip
sudo pip install swiftly eventlet


SWIFTLY_AUTH_URL=https://identity.api.rackspacecloud.com/v2.0

# your Rackspace cloud username
# Username used to login to control panel
SWIFTLY_AUTH_USER=myuser      
CUSTOMERID=123456798

# your Rackspace cloud API key
# Find the APIKey in the 'account settings' part of the menu of the control panel
APIKEY='fake0u23jiofds9032ijofds09823rijpo'
SWIFTLY_AUTH_KEY=$APIKEY       
# 3 char region code for where your exported image is located (e.g., ORD)
SWIFTLY_REGION=DFW        
REGION_EXPORTING_FROM=dfw
# what you want the downloaded image file to be named
LOCALFILENAME=MyDownloadedServer    
 # the container in Cloud Files containing your exported image
CONTAINER=export

# Find the image ID you'd like to make available on cloud files
# set the image id below of the image you want to copy to cloud files, see in control panel
IMAGEID=fake581e-c14561-3c46-45687-e045646675
IMAGEFILENAME=$IMAGEID    # the name of your exported image in Cloud Files

# This section simply retrieves the TOKEN
TOKEN=$(curl -s https://identity.api.rackspacecloud.com/v2.0/tokens -X POST -d '{"auth":{"RAX-KSKEY:apiKeyCredentials":{"username":"'${SWIFTLY_AUTH_USER}'","apiKey":"'${APIKEY}'"}}}' -H "Content-type: application/json" | python -c 'import json, sys; data = json.loads(sys.stdin.read()); print data["access"]["token"]["id"]')

# IMPORTANT: change receiving_swift_container to whatever $CONTAINER is
# This section requests the Glance API to copy the cloud server image uuid to a cloud files container called export
curl "https://$REGION_EXPORTING_FROM.images.api.rackspacecloud.com/v2/$CUSTOMERID/tasks" -X POST -H "X-Auth-Token: $TOKEN" -H "Content-Type: application/json" -d '{"type": "export", "input": {"image_uuid": "'"$IMAGEID"'", "receiving_swift_container": "export"}}'

# The above command simply set a pending command. Go play a game while it finishes.
sleep 4h;

swiftly   --auth-url=$SWIFTLY_AUTH_URL  --auth-user=$SWIFTLY_AUTH_USER   --auth-key=$SWIFTLY_AUTH_KEY   --region=$SWIFTLY_REGION   --verbose   get    --output=${LOCALFILENAME}  ${CONTAINER}/${IMAGEFILENAME}

欲了解更多資訊;

1) 將影像匯出到雲端文件

您可以使用 API 將映像從 Rackspace 匯出到您的雲端文件容器。下面的文章可以指導您完成流程。

從 Rackspace 雲端匯出雲端伺服器映像

https://community.rackspace.com/products/f/25/t/7089?_ga=1.161905660.1332227198.1487618904


您也可以使用一個名為「Pitchfork」的工具。使用使用者名稱和 API 金鑰登入 Pitchfork 後,您將導航至「圖像」部分並選擇「匯出」。運行該 API 呼叫後,需要一段時間才能在一個或多個雲端檔案容器中看到該映像。

叉:https://pitchfork.rax.io/

https://community.rackspace.com/products/f/25/t/6432?_ga=1.161936636.1332227198.1487618904

2)從雲端檔案下載圖片

您可以使用 Swiftly 從雲端檔案下載圖片。雲端檔案中的物件不能大於 5GB。如果您的圖像大於此值,它將被分為多個 Cloud 檔案對象,可以使用 Swiftly 下載並在本地重新組裝這些對象。

https://support.rackspace.com/how-to/use-swiftly-to-download-an-exported-image/

答案3

Rackspace 目前沒有公開下載伺服器映像的功能,但這並不代表您永遠無法獲得該功能。

Rackspace 完全沒有記錄這一點,但他們過去曾根據其他客戶的要求這樣做:

如果您的伺服器沒有回應並且您輸入了支援票證,Rackspace 通常可以拍攝您的伺服器的緊急快照並為您提供下載連結。對於 Linux 實例,Rackspace 將提供您的磁碟/分割區的 gzip 壓縮原始映像;對於 Windows 實例您將收到一個 VHD。

答案4

將圖像匯出到雲端檔案後(我使用了 Pitchfork,如另一個答案中所述),現在下載它就很簡單了:

在此輸入影像描述

相關內容