TurnKey Linux Virtual Appliance Library

Migrate Turnkey AMI to another AWS account

timc's picture

OK so I've got a configured Turnkey machine image I used to demo to a customer. Now the customer wants to go live with it but move it or copy it rather under their own AWS account login.

How should I do this or what's the best way?

Thanks.

Jeremy Davis's picture

Not sure if it's the best way...

But one way you could do it is do a TKLBAM backup of your prototype machine. Then get the customer to fire up the base image under their AWS/Hub account and give you root access. Then restore your backup to new machine on the customer's AWS/Hub account. Once you are happy that it is all functioning as it should, unlink it from your TKLBAM/Hub account (ie remove your Hub API key). If your customer is keen, you could finalise by linking the machine to their TKLBAM/Hub account (for automated backups).

Liraz Siri's picture

Ah, you beat to it again! :)

Ah, you beat to it again! :)

Martin Carpentier's picture

How to unlink the API key ?

Hi Jed,

sorry to dig up an old post but I'm looking for a solution to my problem and this is the closest info I managed to find.

My scenario is similar to the original poster.
In my case I had to install a Redmine appliance in a VM on my computer at work for the project I was working on and linked TKLBAM to my personal HUB account.
Now that my job is finished, the client would like to keep the appliance (lots of project related info is stored there) but I don't want to keep paying for the backups and I don't want to risk having them reactivate the backup through my Hub account.

So my question is, how can I unlink the machine from my TKL Hub account?
I looked everywhere and I didn't find an option to remove/change the API key.
All I can see is a "cancel account" in my Hub profile but that would be a bit extreme I think.

Thanks in advance for your help

Jeremy Davis's picture

Good Question

And to be completely honest I'm not 100% sure. I know it can work in theory but haven't ever done it myself. You should be able to replace your API key with theres using the --force switch with tklbam-init but I'm not sure if you can use that to just remove your key (without adding a new one). eg

tklbam-init --force

Perhaps you could just remove tklbam (and purge data) and then reinstall it?

apt-get remove --purge tklbam
apt-get install tklbam

Martin Carpentier's picture

Jeremy, thanks for your help

Jeremy, thanks for your help but unfortunately none of the suggested options worked.

The tklbam-init commands expects a valid API key and the link was preserved after removing and re-installing tklbam through apt-get.

It seems like the only options left is to either close my hub account (and cancel it on AWS) or to ask the client to create an account of their own and set it up on the machine.

As a suggestion to the devs, maybe they could implement something to be able to unlink the machine from the Hub. Similar to how you can unlink Google authentication to an application from your Google account.

 I should of thought about that a bit sooner. I really was expecting to be able to manage that kind of scenario directly from the Hub.

Anyway, thanks again.

Jeremy Davis's picture

Sorry I couldn't help

We really need one of the devs to give us some pointers.

In the meantime perhaps you could investigate the tklbam-init script to see where it is storing the API key and manually remove it from whatever config file it is using?

Jeremy Davis's picture

Here you go!

To reset the initialisation of TKLBAM, remove the encrypted local copy of the Hub API key. It's stored in /var/lib/tklbam so this should reset TKLBAM:

rm -rf /var/lib/tklbam

Martin Carpentier's picture

Thank you Jeremy!

I tested it on a local VM and it worked.

Unfortunately I don't have access to the client's VM anymore. I sent them the info and hopefully they'll run it so I don't get any surprises in the future.

I still think it would be better if we could control that aspect directly through the hub. It would be a great feature to add if it's technically possible.

Anyway, thanks again for you help.

Guest's picture

Works a treat

Cheers Jeremy for this post, the command below works a treat

rm -rf /var/lib/tklbam

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong> <font> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <strike> <caption>

More information about formatting options

Leave this field empty. It's part of a security mechanism.
(Dear spammers: moderators are notified of all new posts. Spam is deleted immediately)