Copying Drive Images from one Account to another
I would like to copy one of my drives to the cloudsigma account of a customer of mine – since I don’t wanna setup a new server if I don’t have to 😉
The default method for doing this, is by FTP. Now, the problem here is…
- it’s very slow
- the FTP connection may drop and this may result in an error (after I copied the drive by FTP, I received an “invalid GPT header” Error with FreeBSD – it seems like the last bit’s haven’t been transferred.)
The best and fastest way is to use the Cloudsigma Scripts.
Download the Image Drive
Requirement: wget has to be installed.
Firstly install those Scripts on the customers Server:
paste the following (UUID_of_the_drive is the UUID of the drive you would like to download from your account):
in order to hide the cleartext username and password in wget, I put this information into .wgetrc:
http_user = CloudsigmaUsername
http_password = CloudsigmaPassword
Now make the file executable:
chmod 775 download.sh
I’m now connecting by VNC to the server in order to execute the download script. I do this by VNC, because I want to be able to shutdown my local PC if the download would take longer than expected.
Upload Image Drive
Requirement: CURL has to be installed.
Download Cloudsigma’s Drive Upload Script first.
wget http://cloudsigma.com/download/cs-upload.sh .
Now, change the vars
as required (data of the account, where you would like to upload the image)
chmod 775 cs-upload.sh
Now, connect again by VNC (the upload takes much longer than the download!) and start the upload:
/DRIVES/cs-upload.sh -n DriveName FILENAME
DriveName is simply the placeholder for the new name of the drive. If you don’t submit -n, the drive will be assigned basename of FILENAME.
The script now automatically splits the input file into 4MB chunks and transfers each chunk gzipped.
After the upload has succeeded, delete the DRIVES dir with all login and password details.
rm -rf /DRIVES/
Upload by FTP
This information is for reference only. Since the FTP transfer is too slow and data may get lost during the transfer.
lftp :~> set ftp:ssl-force yes
lftp :~> set ssl:verify-certificate no
lftp :~> connect ftp.cloudsigma.com lftp :~> login CloudsigmaUsername
Now download with get – and after download ftp to the other account and upload with put.
You can also transfer the file directly from one account to the other with the mirror command. But this is VERY slow. Even slower than downloading it first and then uploading it again.
lftp :~> login CloudsigmaSourceUsername
lftp :~> mirror /DRIVEIMAGES/ -i "^DriveName" ftp://CloudsigmaDestinationPassword@ftp.cloudsigma.com:21:/DRIVEIMAGES/
Didn't find any related posts :(