how to get background operation working and ssh

Morgan    Jul 3 5:17PM 2017

Hi I'm having a frustrating time now getting vertical backup to work right in the demo before I buy it.

The latest problem is that when I run in the foreground in a shell, if the GUI machine reboots, the remote process stops. This has happened to me twice due to a hardware issue on the GUI machine I'm using to remote log in.

So I have tried to get vertical backup working to run in the background, and have failed so far.

The first sub-problem is that I can't get it to deal with ssh public keys. I got my private key installed locally and put the pub key on the remote (backup) destination. I can log in via ssh with no password now.

So, I tried to interpret what you meant in the limited documentation by "json key-value pairs" and I put the following in the passwords file under .verticalbackup:

  ssh_key : { name : 'ssh_key', value : '/.ssh/id_rsa'}

Then it threw an error:

 Traceback (most recent call last):
  File "vertical_main.py", line 141, in <module>
 File "vertical_backup.py", line 497, in backupCommand
 File "vertical_storage.py", line 38, in createStorage
 File "vertical_utils.py", line 239, in retrievePassword
 File "vertical_utils.py", line 44, in LOG_WARNING
 File "vertical_utils.py", line 75, in log
 ValueError: unsupported format character ''' (0x27) at index 30 Failed to execute script vertical_main

Allright, so I tried just running it at the command line and it barfs:

Vertical Backup 1.0.3
Trial license expires on 2017-07-28
host's password (leave blank to choose public key authentication):
Enter the path of the ssh private key file:/.ssh/id_rsa
Enter the passphrase of the ssh private key file:
Traceback (most recent call last):
  File "vertical_main.py", line 141, in <module>
  File "vertical_backup.py", line 497, in backupCommand
  File "vertical_storage.py", line 43, in createStorage
NameError: global name 'key' is not defined
Failed to execute script vertical_main

Ok, back to square one. So I try just doing a plain old direct command line backup using the password:

Storage set to sftp://hostname.com//path-to-store
Listing all virtual machines
Backing up vmname, id: 3, vmx path: vmpath, guest os: centos64Guest
No previous backup found
Virtual machine name is powered on
Removing all snapshots of vmname
Creating a new virtual machine snapshot for vmname
Uploaded file /vmfs/volumes/datastore1/webuzo1/Webuzo.vmdk
Uploaded file /vmfs/volumes/datastore1/webuzo1/owncloudConv.vmdk
Uploading file owncloudConv-flat.vmdk
Uploading ------------------------------------------------------------------------ 6.33MB/s 22:33:49 0.1%

You'll note that it says "No previous backup found". Yet it has already put over 44.5G of data onto the destination from previous backup attempts. So now I'm confused about whether it is using this previous data in the de-duplication or not, and why it didn't find the previous attempts.

Please help get this working right.

Thanks


Morgan    Jul 3 5:45PM 2017

Update: I was able to get vertical backup to run in the background by starting it normally then doing ^z and bg.

However, this did not help my problem. When I closed the terminal, even with it running in background, it killed the process.

Is the only way to make this work via a cron?

I'm afraid to try that because I've spent so much time already just getting a basic/regular backup of ~50G to work.


gchen    Jul 3 9:10PM 2017

After you ssh into esxi, run nohup vertical backup .... This guarantees that it will remain running after the ssh connection is terminated.

When the initial backup is interrupted, no backup will be saved but all chunks will remain in the storage. Therefore, next time you run the backup again it will skip all chunks that have been uploaded so it will get to the resume point fairly quick.


Morgan    Jul 3 9:45PM 2017

Hi gchxn, thanks - that solves two of the issues.

However, it doesn't say anything about how to get the ssh working without a password, which I presume is necessary once I want to set up a cron.

Thanks


gchen    Jul 4 10:55AM 2017

Sorry I missed that. That looks like a bug -- I'll fix it later today.


Morgan    Jul 4 2:37PM 2017

Thank you. I have one more issue of backup slowness, but I will post separately.


gchen    Jul 5 3:31PM 2017

If you download again from http://verticalbackup.com/esxi/vertical it will be version 1.0.4 that has the public key authentication fixed.


Jeff D    Aug 22 10:30PM 2017

I'm having a similar issue with version 1.1.1, but with a strange twist.

My ./verticalbackup/passwords file: ssh_key : { name : 'ssh_key', value : '/.ssh/id_rsa' }. Running init failed until I removed .verticalbackup/passwords, and then I was able to init manually. Same thing happens when using 'vertical backup ' - I'm successful only when the passwords file is removed. Here's the following error:

[root@vmsrv:/vmfs/volumes/592b3dbf-66cd5ad3-48d3-2c41399ad6ad/verticalbackup] ./vertical backup vm001
Vertical Backup 1.1.1
Trial license expires on 2017-09-20
Traceback (most recent call last):
  File "vertical_main.py", line 143, in 
  File "vertical_backup.py", line 501, in backupCommand
  File "vertical_storage.py", line 38, in createStorage
  File "vertical_utils.py", line 252, in retrievePassword
  File "vertical_utils.py", line 46, in LOG_WARNING
  File "vertical_utils.py", line 88, in log
ValueError: unsupported format character ''' (0x27) at index 30
Failed to execute script vertical_main
But there's more! So I'm running it without the passwords file again, and as expected it asks me for the path of the private key. But this time I make a typo and put in the wrong filename. To my surprise, the backup works anyway. Total success. I tried it with a different sftp destination (first was FreeNAS, second was Centos 7) with same results. But putting back that passwords file, and I'm met with the error again.

Do I have the file format wrong?

Thanks, Jeff


gchen    Aug 23 12:59PM 2017

The json file should be like this:

{
"ssh_key": "/.ssh/id_rsa"
}

I don't know why it would work with a wrong key file name. Maybe the wrong file was in fact also a correct one?


Jeff D    Aug 24 12:48PM 2017

Not sure about the key file thing, but the correct format did the trick. Thank you!


Jeff D    Aug 25 10:30AM 2017

For those looking to use sftp public key auth with no passphrase, make sure you specify that there's no password and passphrase by creating the password file as:

{
"ssh_key": "/.ssh/id_rsa", "ssh_pass": "", "ssh_key_pass": ""
}


Log in to comment
Copyright © Acrosync LLC 2017