- Community Home
- >
- Software
- >
- HPE Morpheus Software
- >
- HPE Morpheus Enterprise
- >
- Making a VM managed through API
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2022 03:15 AM
04-13-2022 03:15 AM
Hi, I was wondering, where is the API call hidden to make an existing VM managed through an API call?
In the UI, I usually go to: Infrastructure > Clouds > “selected cloud” > VMs > +Virtual Machine > Linux VM.
I fill in the wizard with name, description, ssh host, ssh user and ssh password.
Once this is done I select the newly added VM and then go to Actions > Convert to Managed
I am looking to write an API call for this, can this be done?
Thanks in advance.
Solved! Go to Solution.
- Tags:
- automation
- instances
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2022 04:18 AM
04-13-2022 04:18 AM
Re: Making a VM managed through API
Thanks Chris for pointing to the hosts section.
I also needed the POST API call to add it to the system when ‘inventory instances’ is not enabled on the cloud. (Which returns the server id upon completion) I did notice that the “computeServerType” is required on this call.
I used 1, which is a blank vm type. When installing the agent it seems to push the type to a correct one, example: ‘Managed Linux Server’.
If I use 203 (code: vmwareVm, name: VMware Linux VM), which would be the appropriate one for this VM, the UI complains no image found.
curl -XPOST $IP/api/servers \
-H "Authorization: BEARER $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"server": {
"sshUsername": "myusername",
"sshPassword": "mypassword",
"sshHost": "10.5.1.1",
"name": "test",
"zone": {"id":3},
"computeServerType": {"id":1},
},
}
'
Kind regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2022 03:18 AM
04-13-2022 03:18 AM
SolutionConvert to managed API is documented here: https://apidocs.morpheusdata.com/#convert-to-managed
Thanks