bosh ssh sudo commands


Schwarz-Fritz, Fabian
 

Hi bosh-freaks,

I do have a technical bosh question regarding bosh ssh . I am curious if you do have any solutions to the problem below or ideas for alternative. Please let me know in case this is the wrong mailing list.

I am currently trying to automate the recovery of an existing snapshot. The snapshot is a backup for a my own bosh-release for a database technology. The boshrelease will have OpenStack as IaaS. I am using several cinder/nova commands (Openstack specific) and then I want to execute several commands on the bosh-vm. Therefore I do need to execute several commands on the bosh-VM where the database is running from the host VM.

In order to do that, I am using bosh ssh "<command>" for example

bosh ssh mongodb/0 “echo blub”

This is working perfectly fine. However, when I automate the recovery a backup, there are a few commands that do need root access. One command could be this one, for example:

bosh ssh mongodb/0 "sudo mount -t ext4 /dev/vdc1 /var/vcap/store_snapshot”

Unfortunately, this is not working. I get a error

sudo: no tty present and no askpass program specified

Does anyone have any help/ideas on how to solve this issue?
Am I using bosh ssh in the wrong way?
Is bosh ssh not made to execute such commands?
Can I solve this by writing an errand and calling the errand in automation script?

I am happy about every idea that helps me solving this issue or letting me better understand the problem.

Thanks a lot in advance,
Cheers,
Fabian

Join cf-bosh@lists.cloudfoundry.org to automatically receive all group messages.