This section describes how to import the SSH key created during the Operations Manager upgrade to VMware Cloud Foundation.
Prerequisites
Retrieve the private SSH key created during the Operations Manager upgrade.
Procedure
- If the key starts with BEGIN OPENSSH PRIVATE KEY, convert the key to RSA format.
- On a Linux computer that has ssh-keygen and puttygen, create a file convertkey.sh with the following content.
> cat convertkey.sh #!/usr/bin/env bash set -e set -x original_key=$1 puttygen_destinaton=${original_key}_puttygen rsa_destinaton=${original_key}_rsa # FROM OPENSSH to SSH2 ENCRYPTED puttygen $original_key -O private-sshcom -o $puttygen_destinaton # FROM SSH2 ENCRYPTED format to RSA ssh-keygen -i -f $puttygen_destinaton > $rsa_destinaton
- Type the following command to convert the file to RSA format:
bash convertkey.sh {{keyfile}}
A file named {{keyfile}}_rsa Is created.
- On a Linux computer that has ssh-keygen and puttygen, create a file convertkey.sh with the following content.
- Create a JSON file. In the JSON file provided below, replace the sample key with your key in RSA format.
Cat Example.json
{"sshKey":"-----BEGIN RSA PRIVATE KEY-----\nMIIJKAIBAAKCAgEAl9ZhHDU3m2aXj5rHmqL98+q9pd1e6FlOetJ060AccLujuZSm\nPqWltOLgW0Q1hoYEo8XOB0iVhUTDdTOtHnHpi7P6JnB0uwPvUs7SpIvy0xwUk6KE\nO4hzIwzv13GnpEXq1SO+jtdz1CFHc1yY0Za5Wg0b/QKCAQEAwUzhnln/+H3i0hW0\n7UXZOynaSVtJlUWFeIuMS4f4D2lAqj0YKSF1PdHS9n6ilmuukxE/cYmEiUoBxDEc\naVpjVvHKNvbwkv0HxdOe+ngojG1N9KE2Bn7NHT+KJv1axi6aqYXiurzT/likOrbA\nd1ZRpnrBTCbDszDKpXoGqX2dQikX7fue2GCYs591GrjH3DJ1zgz2SmR8xAC1Pvu3\nwUi2w2UdijH0uP/Jo/dICs+ldhk+HySmOiXJEbTuGc1yfQHSyIUTASK2ygA+MGR8\nF5YG3SdRa1w49yTJxQH20suXivitOYetOkxPt8RYzHykn2KN9X9OIC4B+Bkgf9VO\n6k4H0QKCAQBvKZt4R6lVUjJ8/3ph9skBjRXa20dEQQ+qFnwYuiXHqrd07jNujOw3\nDgDtF+yJNK1sB3WkUcDEHcbs95A49XOTcPjy1vpMHxzQe/rAv1YHMo9C5P+cD9LX\nzXEb13QpBECkVVte8fA8HDe4/vJt9wvW0WGtmFj6kb3lw+fn2r57vTlZiKinoOVZ\nv6wynrD/OsGuJmYHoB46BfQ3Tccc0nksSdarAvl1PuxnXBQ7O7+KP5n4jzUuTRPu\nhHMq1wWdGOkPWgVM61DAxe4NtR2EXp10UOeNFBPN0Lzq4hCNlB3qvikGPqbLq3Bs\nEjIVeXHSVwh/eMNm2SZt5CI+h4NgGkx9AoIBAB3T+9ETFmwTbjbMYKoLIdM5c8G6\n2ytqqYt/wifnF6Pn5CtP49+UviKdML8fD6MtEf1Pc0bLFLe9DNuh6Pr8NTbHH1yw\nNk4HJM/sjbctj0Ro6iSTHdf7qbW1iLh6gQCUDu78ES/z5VQUx38yeA4ZSnFDJuzp\nV1qvdyZdscT2/ZxPcHGjupylI6XC9MYd4bKVywRpNyUHK7qq7jlyakV9HyUkxSlG\nbPtCDgAtpHiA4c7AeQdiYk0Sp+zgqgxnScboLV6rv2cZtJEzi7YPGqz8fOwHQpPi\ntStrrNVmTNEiXKOzfoDv7UUKiqvCoNQk9JAP3pnM1udihTcuM2xgL4Cbycw=\n-----END RSA PRIVATE KEY-----\n"}
- Run the following command to copy the Example.json file to SDDC Manager.
curl -H'Content-type: application/json' -H'Accept: application/json' -XPOST localhost/solutions/discovery/d695d9a0-fe5f-4efb-ac3c-ff6b09f44a5b/opsmanagersshkey -d @Example.json