- Community Home
- >
- Software
- >
- HPE Morpheus Software
- >
- HPE Morpheus Enterprise
- >
- Re: Edit Instance Configuration Before Deployment
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
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
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
05-03-2022 09:01 AM
05-03-2022 09:01 AM
Good morning!
I’m attempting to edit a GCP instance deployment to attach a public IP in the Configuration Phase of a Workflow using Python. I feel I’m close but something is just not clicking for it to stick I think. This is my example code with the IP changed (task outputs as JSON):
import json
newIP="255.255.255.255"
morpheus['spec']['config']['externalIpType']=newIP
morpheus['spec']['server']['config']['externalIpType']=newIP
morpheus['spec']['customOptions']['externalIpType']=newIP
json.dumps(morpheus)
I’ve also tried not doing the output of JSON and just modifying the dictionary. Through my various tests, the config data from using the GUI to choose the IP and from injecting my code above, end up being almost identical (except for the unique values) at the end of the task output.
If I print the morpheus
variable on the instance after deployment using a task, I see the externalIpType was not set like it showed in the task output. Is there a way to “apply” the changes that I’m missing?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2022 09:09 AM
05-03-2022 09:09 AM
Re: Edit Instance Configuration Before Deployment
I have time in an hour if you want to look at it together.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2022 11:42 AM
05-03-2022 11:42 AM
Re: Edit Instance Configuration Before Deployment
it’s literally complaining on step 1 saying it can’t monitor for keywords. Wonder if any flow is triggering now
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2022 11:42 AM
05-03-2022 11:42 AM
Re: Edit Instance Configuration Before Deployment
Maybe they are having an issue right now. I can try it again later or tomorrow.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2022 11:43 AM
05-03-2022 11:43 AM
Re: Edit Instance Configuration Before Deployment
last successful and history don’t align either
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2022 11:41 AM
05-03-2022 11:41 AM
Re: Edit Instance Configuration Before Deployment
odd… I honestly think M$ broke flows

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2022 11:35 AM
05-03-2022 11:35 AM
Re: Edit Instance Configuration Before Deployment
Has to be its own comment?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2022 11:45 AM
05-03-2022 11:45 AM
Re: Edit Instance Configuration Before Deployment
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2022 09:10 AM
05-03-2022 09:10 AM
Re: Edit Instance Configuration Before Deployment

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2022 11:43 AM
05-03-2022 11:43 AM
Re: Edit Instance Configuration Before Deployment
better go check mine
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2022 11:36 AM
05-03-2022 11:36 AM
Re: Edit Instance Configuration Before Deployment
Mine was.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2022 11:42 AM
05-03-2022 11:42 AM
Re: Edit Instance Configuration Before Deployment

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2022 09:09 AM
05-03-2022 09:09 AM
Re: Edit Instance Configuration Before Deployment
I have played a bit with the externalIp and I think I have some code on it somewhere

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2022 11:36 AM
05-03-2022 11:36 AM
Re: Edit Instance Configuration Before Deployment

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2022 10:57 AM
05-03-2022 10:57 AM
SolutionThanks for the help, Jabro! Here is the final result that worked, for getting the changes to apply. Basically I was missing the print()
so the output would go to standard out. This would require the output type of the task to be JSON.
import json
newIP="255.255.255.255"
morpheus['spec']['config']['externalIpType']=newIP
morpheus['spec']['server']['config']['externalIpType']=newIP
morpheus['spec']['customOptions']['externalIpType']=newIP
print(json.dumps(morpheus))
Below is another example using PWSH. Note that Python stores all of the values in a single variable of morpheus
but other languages can work differently. In this case, PWSH stores the spec
as its own variable, so we work with it directly:
$newIP = '255.255.255.255'
$configObject = '<%=spec.encodeAsJson().toString()%>' | ConvertFrom-Json -Depth 10
$configObject.config.externalIpType = $newIP
$configObject.server.config.externalIpType = $newIP
$configObject.customOptions.externalIpType = $newIP
$configJson = $configObject | ConvertTo-Json -Depth 10
$spec = @"
{
"spec": $configJson
}
"@
Write-Host $spec -NoNewline

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2022 05:59 AM
06-29-2022 05:59 AM
Re: Edit Instance Configuration Before Deployment
Similar one with the logic of a selection of a custom option to set value of another which is hidden input type
import json
# Declare the lifecycle and OU Name option list as a variable with contents
updatedLifecycle={"P":"PROD", "U":"UAT"}
updatedOU={"P":"Prod", "U":"NON-Prod"}
configspec = morpheus['spec']
env=configspec['customOptions']['Env']
# Check if the value if env is present in lifecycle and OU Name
if env in updatedLifecycle and env in updatedOU:
# Set the value of lifecycle and ou name option type based on the value of env selected by user
configspec['config']['customOptions']['LifecycleRole'] = updatedLifecycle[env]
configspec['server']['config']['customOptions']['LifecycleRole'] = updatedLifecycle[env]
configspec['customOptions']['customOptions']['LifecycleRole'] = updatedLifecycle[env]
configspec['config']['customOptions']['LifecycleRole'] = updatedLifecycle[env]
configspec['customOptions']['LifecycleRole'] = updatedLifecycle[env]
configspec['config']['customOptions']['OUName'] = updatedOU[env]
configspec['server']['config']['customOptions']['OUName'] = updatedOU[env]
configspec['customOptions']['customOptions']['OUName'] = updatedOU[env]
configspec['config']['customOptions']['OUName'] = updatedOU[env]
configspec['customOptions']['OUName'] = updatedOU[env]
newspec = {}
newspec['spec'] = configspec
print(json.dumps(newspec))