Depending on what you actually want to achieve, you could also register a bogus public key and reset to that one, knowing it will never really work.
Lucian -- Sent from the Delta quadrant using Borg technology! Nux! www.nux.ro ----- Original Message ----- > From: "Francois Gaudreault" <fgaudrea...@cloudops.com> > To: "Nux!" <n...@li.nux.ro> > Cc: dev@cloudstack.apache.org > Sent: Monday, 16 February, 2015 23:53:52 > Subject: Re: Remove/Change SSH Keys from instance > Thanks for looking at it and testing it. > > That answers the key replacement. Looks like there is no way to actually > removing the key from a created VM. I believe the only way left is the > deletion. The updateVM call won't update it either :S > > FG > > On 2015-02-16 6:37 PM, Nux! wrote: >> "resetSSHKeyForVirtualMachine >> Resets the SSH Key for virtual machine. The virtual machine must be in a >> "Stopped" state. [async]" >> >> Apologies for causing you extra stress. We all had a long Monday. >> >> I also never used this function before and here's how I tested. >> >> - empty or move /root/.ssh/authorized_keys on the VM prior to the operation >> - in cloudmonkey >> - stop virtualmachine id=XXX >> - reset sshkeyforvirtualmachine keypair=newkey id=XXX >> - start virtualmachine id=XXX >> - after it came back I checked /root/.ssh/authorized_keys and .. lo & behold, >> the new key was there. >> >> So, answer: yes, that's how to reset the SSH key and no, you can't remove it >> that way - it will check if the provided key name actually exists and you >> must >> provide one. >> >> ☕ :-) >> >> >> -- >> Sent from the Delta quadrant using Borg technology! >> >> Nux! >> www.nux.ro >> >> ----- Original Message ----- >>> From: "Francois Gaudreault" <fgaudrea...@cloudops.com> >>> To: "Nux!" <n...@li.nux.ro> >>> Cc: dev@cloudstack.apache.org >>> Sent: Monday, 16 February, 2015 22:22:34 >>> Subject: Re: Remove/Change SSH Keys from instance >>> Yes what? That API call is not clear at all. >>> >>> I guess a "try it yourself" is what you meant? >>> >>> Thanks for your great help. >>> >>> FG >>> On Feb 16, 2015 5:04 PM, "Nux!" <n...@li.nux.ro> wrote: >>> >>>> yes? >>>> >>>> >>>> https://cloudstack.apache.org/docs/api/apidocs-4.4/user/resetSSHKeyForVirtualMachine.html >>>> >>>> -- >>>> Sent from the Delta quadrant using Borg technology! >>>> >>>> Nux! >>>> www.nux.ro >>>> >>>> ----- Original Message ----- >>>>> From: "Francois Gaudreault" <fgaudrea...@cloudops.com> >>>>> To: dev@cloudstack.apache.org >>>>> Sent: Monday, 16 February, 2015 20:03:59 >>>>> Subject: Remove/Change SSH Keys from instance >>>>> Hi, >>>>> >>>>> Quick question, using the API, how would a user remove an associated SSH >>>>> keys to an instance? What call should we use? Seems that you can't based >>>>> on the existing API calls. >>>>> >>>>> Furthermore, how can we change the SSH Key? Is it the >>>>> resetSSHKeyForVirtualMachine call? >>>>> >>>>> Thanks. >>>>> >>>>> -- >>>>> Francois Gaudreault >>>>> Gestionnaire de Produit | Product Manager - Cloud Platform & Services >>>>> t:514-629-6775 >>>>> >>>>> CloudOps Votre partenaire infonuagique | Cloud Solutions Experts >>>>> 420 rue Guy | Montreal | Quebec | H3J 1S6 >>>>> w: cloudops.com | tw: @CloudOps_ >> > > > -- > Francois Gaudreault > Gestionnaire de Produit | Product Manager - Cloud Platform & Services > t:514-629-6775 > > CloudOps Votre partenaire infonuagique | Cloud Solutions Experts > 420 rue Guy | Montreal | Quebec | H3J 1S6 > w: cloudops.com | tw: @CloudOps_