Bikram,
I see and extra parameter "keypairs" that would not be recognised and hence
ignored but otherwise your cli seem correct according to [1]

I think you hit a bug, please investigate the logs and create an issue at
[2] if you feel it is a  cloudstack issue or at [3] if it is a cmk issue

[1]
http://cloudstack.apache.org/api/apidocs-4.15/apis/resetSSHKeyForVirtualMachine.html
[2] https://github.com/apache/cloudstack/issues/new/choose
[3] https://github.com/apache/cloudstack-cloudmonkey/issues/new/choose

regards,

On Fri, Jun 25, 2021 at 9:01 AM Bikram Biswas <bickrombishs...@gmail.com>
wrote:

> Here is the command and message in cloudmonkey. The VM is connected with
> the ssh-key-pair with the name 'myname'
>
> (bicrxm) 🐱 > reset sshkeyforvirtualmachine account=admin
> domainid=a7509cc5-d50e-11eb-afe0-646e69d9cd09 keypair=myname
> id=c9e37866-2314-46f8-8741-9b2d045ad40a keypairs=myname
> {
>   "accountid": "a751fb3a-d50e-11eb-afe0-646e69d9cd09",
>   "cmd":
> "org.apache.cloudstack.api.command.admin.vm.ResetVMSSHKeyCmdByAdmin",
>   "completed": "2021-06-25T12:24:47+0530",
>   "created": "2021-06-25T12:24:45+0530",
>   "jobid": "53db8eca-cf4c-4eb6-a9f2-a37d54af0f7d",
>   "jobinstanceid": "c9e37866-2314-46f8-8741-9b2d045ad40a",
>   "jobinstancetype": "VirtualMachine",
>   "jobprocstatus": 0,
>   "jobresult": {
>     "errorcode": 530,
>     "errortext": "Caught: com.mysql.cj.jdbc.ClientPreparedStatement:
> SELECT ssh_keypairs.id, ssh_keypairs.account_id, ssh_keypairs.domain_id,
> ssh_keypairs.keypair_name, ssh_keypairs.fingerprint,
> ssh_keypairs.public_key FROM ssh_keypairs WHERE ssh_keypairs.account_id =
> 2  AND ssh_keypairs.domain_id = 1  AND ssh_keypairs.keypair_name = ** NOT
> SPECIFIED **  ORDER BY ssh_keypairs.keypair_name DESC "
>   },
>   "jobresultcode": 530,
>   "jobresulttype": "object",
>   "jobstatus": 2,
>   "userid": "a781b145-d50e-11eb-afe0-646e69d9cd09"
> }
> 🙈 Error: async API failed for job 53db8eca-cf4c-4eb6-a9f2-a37d54af0f7d
> (bicrxm) 🐱 >
>
>

-- 
Daan

Reply via email to