<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to Inject SSH Public key during instance creation using Morpheus APIs in HPE Morpheus Enterprise Software</title>
    <link>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/how-to-inject-ssh-public-key-during-instance-creation-using/m-p/7251222#M4396</link>
    <description>&lt;P&gt;I have added Linux user under user settings and updated the SSH Key pair.&lt;BR /&gt;
When i provision Instance with &lt;STRONG&gt;“createUser”: true&lt;/STRONG&gt;, it has created the user and i’m able to do passwordless login to that VM.&lt;BR /&gt;
This concludes that &lt;STRONG&gt;publicKeyId&lt;/STRONG&gt; option is not working because even though i have specified a different publicKeyId than the one which i updated in the linux user settings. it is still not picking it. It is only picking the key pair which is in the Linux user settings.&lt;/P&gt;
&lt;P&gt;What is the right usage of using publicKeyId then ?&lt;/P&gt;</description>
    <pubDate>Thu, 12 May 2022 04:57:22 GMT</pubDate>
    <dc:creator />
    <dc:date>2022-05-12T04:57:22Z</dc:date>
    <item>
      <title>How to Inject SSH Public key during instance creation using Morpheus APIs</title>
      <link>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/how-to-inject-ssh-public-key-during-instance-creation-using/m-p/7251217#M4391</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I’m using this API Documentation to create a Instance &lt;A href="https://apidocs.morpheusdata.com/#create-an-instance" rel="noopener nofollow ugc"&gt;https://apidocs.morpheusdata.com/#create-an-instance&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;I have already created a Key Pair for SSH Public Key.&lt;BR /&gt;
In the CreateInstance POST method body, under &lt;A href="https://apidocs.morpheusdata.com/#config" rel="noopener nofollow ugc"&gt;config field&lt;/A&gt; there is a provision to add &lt;STRONG&gt;publicKeyId&lt;/STRONG&gt;, So i have added the Key pair ID which I have created.&lt;/P&gt;
&lt;P&gt;but once the Instance is provisioned, i am unable to do password less login.&lt;BR /&gt;
the ~/.ssh/authorized_keys file is empty only.&lt;/P&gt;
&lt;P&gt;How do I inject or map my ssh public key while creating Instance.&lt;/P&gt;</description>
      <pubDate>Wed, 11 May 2022 15:13:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/how-to-inject-ssh-public-key-during-instance-creation-using/m-p/7251217#M4391</guid>
      <dc:creator />
      <dc:date>2022-05-11T15:13:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to Inject SSH Public key during instance creation using Morpheus APIs</title>
      <link>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/how-to-inject-ssh-public-key-during-instance-creation-using/m-p/7251218#M4392</link>
      <description>&lt;P&gt;(post deleted by author)&lt;/P&gt;</description>
      <pubDate>Mon, 16 May 2022 03:04:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/how-to-inject-ssh-public-key-during-instance-creation-using/m-p/7251218#M4392</guid>
      <dc:creator />
      <dc:date>2022-05-16T03:04:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to Inject SSH Public key during instance creation using Morpheus APIs</title>
      <link>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/how-to-inject-ssh-public-key-during-instance-creation-using/m-p/7251219#M4393</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;The &lt;STRONG&gt;publicKeyId&lt;/STRONG&gt; option should tell Morpheus to copy the specified Morpheus AccountKeyPair public key to the authorized_keys file for the username configured on the Host settings for the virtual machine. This could be the cloud-init user as configured in Administration &amp;gt; Provisioning as mentioned by &lt;A class="mention" href="https://community.hpe.com/u/cbunge"&gt;@cbunge&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;Have you tried looking in authorized_keys for the cloud-init user?&lt;/P&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 12 May 2022 12:27:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/how-to-inject-ssh-public-key-during-instance-creation-using/m-p/7251219#M4393</guid>
      <dc:creator>cdtaylor</dc:creator>
      <dc:date>2022-05-12T12:27:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to Inject SSH Public key during instance creation using Morpheus APIs</title>
      <link>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/how-to-inject-ssh-public-key-during-instance-creation-using/m-p/7251220#M4394</link>
      <description>&lt;P&gt;I haven’t passed Create user flag. i’m trying to create VM on ESXi&lt;/P&gt;</description>
      <pubDate>Wed, 11 May 2022 17:46:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/how-to-inject-ssh-public-key-during-instance-creation-using/m-p/7251220#M4394</guid>
      <dc:creator />
      <dc:date>2022-05-11T17:46:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to Inject SSH Public key during instance creation using Morpheus APIs</title>
      <link>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/how-to-inject-ssh-public-key-during-instance-creation-using/m-p/7251221#M4395</link>
      <description>&lt;P&gt;Are you passing the create user flag?  I’ll have to test this to confirm things on my end.&lt;/P&gt;
&lt;P&gt;Also, which cloud type are you deploying to?&lt;/P&gt;</description>
      <pubDate>Wed, 11 May 2022 15:43:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/how-to-inject-ssh-public-key-during-instance-creation-using/m-p/7251221#M4395</guid>
      <dc:creator>cbunge</dc:creator>
      <dc:date>2022-05-11T15:43:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to Inject SSH Public key during instance creation using Morpheus APIs</title>
      <link>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/how-to-inject-ssh-public-key-during-instance-creation-using/m-p/7251222#M4396</link>
      <description>&lt;P&gt;I have added Linux user under user settings and updated the SSH Key pair.&lt;BR /&gt;
When i provision Instance with &lt;STRONG&gt;“createUser”: true&lt;/STRONG&gt;, it has created the user and i’m able to do passwordless login to that VM.&lt;BR /&gt;
This concludes that &lt;STRONG&gt;publicKeyId&lt;/STRONG&gt; option is not working because even though i have specified a different publicKeyId than the one which i updated in the linux user settings. it is still not picking it. It is only picking the key pair which is in the Linux user settings.&lt;/P&gt;
&lt;P&gt;What is the right usage of using publicKeyId then ?&lt;/P&gt;</description>
      <pubDate>Thu, 12 May 2022 04:57:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/how-to-inject-ssh-public-key-during-instance-creation-using/m-p/7251222#M4396</guid>
      <dc:creator />
      <dc:date>2022-05-12T04:57:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to Inject SSH Public key during instance creation using Morpheus APIs</title>
      <link>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/how-to-inject-ssh-public-key-during-instance-creation-using/m-p/7251223#M4397</link>
      <description>&lt;P&gt;&lt;A class="mention" href="https://community.hpe.com/u/cbunge"&gt;@cbunge&lt;/A&gt; &lt;A class="mention" href="https://community.hpe.com/u/ctaylor"&gt;@ctaylor&lt;/A&gt;&lt;BR /&gt;
I have observed that, Adding the &lt;STRONG&gt;publicKeyId&lt;/STRONG&gt; in config section won’t make any difference as it always pick the ssh key pair which is added in the Cloud Init settings for the mentioned user.&lt;/P&gt;
&lt;P&gt;My use-case is different.&lt;BR /&gt;
I want to create a user which is mentioned in the payload under config section and pick the publickeyId which is again mentioned in the payload for the same user. passwordless login should happen for the user.&lt;/P&gt;
&lt;PRE style="background : #f0f1f2;"&gt;&lt;CODE class="lang-auto"&gt;"config": {
    "publicKeyId": 12,
    "template": 34,
    "resourcePoolId": 34, 
    "noAgent": false,
    "vmwareFolderId": "group-v421"
    "createUser": true,
    "vmwareUsr": "mark",
    "vmwarePwd": "Password!234"
}
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;As per this, i expect that user &lt;STRONG&gt;mark&lt;/STRONG&gt; should be created and passwordless login should happen for the &lt;STRONG&gt;publicKeyId 12&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Hope i am clear on my requirement.&lt;/P&gt;</description>
      <pubDate>Thu, 12 May 2022 12:30:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/how-to-inject-ssh-public-key-during-instance-creation-using/m-p/7251223#M4397</guid>
      <dc:creator />
      <dc:date>2022-05-12T12:30:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to Inject SSH Public key during instance creation using Morpheus APIs</title>
      <link>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/how-to-inject-ssh-public-key-during-instance-creation-using/m-p/7251224#M4398</link>
      <description>&lt;P&gt;If your user profile has a password and key assigned, you can set the “createUser”: true flag and it’ll automatically set your user and key under that user’s home dir.  No need to specifically call a key id.&lt;/P&gt;
&lt;P&gt;If this is a 3rd party user you are trying to add, create a “user group” in Morpheus.  Add the user(s) to that group, then in the payload define the usergroup you are adding.  Again, any user added this way must have their username/pass/key defined in their Morpheus User profile.  At which time, Morpheus will create all of those users and define their keys.&lt;/P&gt;</description>
      <pubDate>Thu, 12 May 2022 13:36:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/how-to-inject-ssh-public-key-during-instance-creation-using/m-p/7251224#M4398</guid>
      <dc:creator>cbunge</dc:creator>
      <dc:date>2022-05-12T13:36:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to Inject SSH Public key during instance creation using Morpheus APIs</title>
      <link>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/how-to-inject-ssh-public-key-during-instance-creation-using/m-p/7251225#M4399</link>
      <description>&lt;ASIDE class="quote no-group" data-username="eepurichandra" data-post="1" data-topic="333"&gt;
eepurichandra:
&lt;BLOCKQUOTE&gt;
&lt;P&gt;/.ssh/authorized_keys&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;/ASIDE&gt;
&lt;P&gt;The first example you posted isn’t proper create local user payload.  That would simply be the “createUser” flag under the config block as shown below.  Note this adds the configure (user/pass/cert) under the provisioning user’s profile for Linux creds.&lt;/P&gt;
&lt;PRE style="background : #f0f1f2;"&gt;&lt;CODE class="lang-auto"&gt;    "config": {
      "resourcePoolId": 1066,
      "publicKeyId": 7,
      "hostId": "",
      "vmwareFolderId": "group-v1038",
      "nestedVirtualization": "off",
      "createUser": true
    }
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Additionally, it appears you are possibly looking at the wrong location for the keys.&lt;BR /&gt;
You must look under the user deploying the system’s home at $home/.ssh/authorized_keys for the user added (and possibly the cloud-init user home configured under Administration &amp;gt; Provisioning)&lt;/P&gt;</description>
      <pubDate>Wed, 11 May 2022 21:55:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/how-to-inject-ssh-public-key-during-instance-creation-using/m-p/7251225#M4399</guid>
      <dc:creator>cbunge</dc:creator>
      <dc:date>2022-05-11T21:55:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to Inject SSH Public key during instance creation using Morpheus APIs</title>
      <link>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/how-to-inject-ssh-public-key-during-instance-creation-using/m-p/7251226#M4400</link>
      <description>&lt;P&gt;I have now tried by passing username and pass in config section but it didn’t work for me.&lt;/P&gt;
&lt;PRE style="background : #f0f1f2;"&gt;&lt;CODE class="lang-auto"&gt;{
    "zoneId": 15,
    "instance": {
        "name": "TEST",
        "cloud": "myCloud",
        "site": {
            "id": 14
        },
        "instanceType": {
            "code": "vmware"
        },
        "layout": {
            "id": 1
        },
        "plan": {
            "id": 2
        }
    },
    "copies": 1,
    "layoutSize": 1,
    "volumes": [
        {
            "id": -1,
            "rootVolume": true,
            "name": "somevol",
            "size": 40,
            "storageType": 0,
            "datastoreId": "auto"
        }
    ],
    "networkInterfaces": [
        {
            "network": {
                "id": 1347
            },
            "networkInterfaceTypeId": 423
        }
    ],
    "config": {
        "publicKeyId": 5,
        "template": 5363,
        "resourcePoolId": 787, 
        "noAgent": false,
        "vmwareFolderId": "g42",
        "vmwareUsr": "demo",
        "vmwarePwd": "demo123"
    }
}
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Without user and pass&lt;/P&gt;
&lt;PRE style="background : #f0f1f2;"&gt;&lt;CODE class="lang-auto"&gt;{
    "zoneId": 15,
    "instance": {
        "name": "TEST",
        "cloud": "myCloud",
        "site": {
            "id": 14
        },
        "instanceType": {
            "code": "vmware"
        },
        "layout": {
            "id": 1
        },
        "plan": {
            "id": 2
        }
    },
    "copies": 1,
    "layoutSize": 1,
    "volumes": [
        {
            "id": -1,
            "rootVolume": true,
            "name": "somevol",
            "size": 40,
            "storageType": 0,
            "datastoreId": "auto"
        }
    ],
    "networkInterfaces": [
        {
            "network": {
                "id": 1347
            },
            "networkInterfaceTypeId": 423
        }
    ],
    "config": {
        "publicKeyId": 5,
        "template": 5363,
        "resourcePoolId": 787, 
        "noAgent": false,
        "vmwareFolderId": "g42"
    }
}
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Let me if i am missing anything when you test.&lt;/P&gt;</description>
      <pubDate>Wed, 11 May 2022 18:14:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/how-to-inject-ssh-public-key-during-instance-creation-using/m-p/7251226#M4400</guid>
      <dc:creator />
      <dc:date>2022-05-11T18:14:58Z</dc:date>
    </item>
  </channel>
</rss>

