Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

include support for more hypervisors, plus runbook #74

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion calm-integrations/publish_blueprints_marketplace/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
# Plublish blueprint to marketplace without substrate spec

## How do we execute this?
You can execute this as a native python script, or as a runbook

## What does this do?
This script publishes existing blueprint to marketplace (LOCAL) within a PC without substrate elements.

## Supported Platforms:
- VCenter
- VCenter, AHV

## Runbook
1. Import the runbook in Prism Central NCM Self-Service
2. Update the credential for PC
3. Update the variables to match your environment
4. Execute the runbook.
Note - the runbook is executed on your local Calm\PC as an escript.

## Inputs for publish_blueprints_to_marketplace.py:
* --pc - PC Ip address
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,45 @@ def remove_platform_data(bp_spec):
for nic in substrate["create_spec"]["resources"]["nic_list"]:
nic["net_name"] = ""
nic["nic_type"] = ""
if substrate['type'] == "AHV_VM":
for disk in substrate["create_spec"]["resources"]["disk_list"]:
if hasattr(disk, "data_source_reference"):
if hasattr(disk["data_source_reference"], 'kind') and disk["data_source_reference"]['kind'] == "image":
disk["data_source_reference"]["name"] = ""
disk["data_source_reference"]["uuid"] = ""
for nic in substrate["create_spec"]["resources"]["nic_list"]:
nic["subnet_reference"]["uuid"] = ""
nic["subnet_reference"]["name"] = ""
if substrate["type"] == "AZURE_VM":
substrate["create_spec"]["resources"]["storage_profile"]["image_details"]["sku"] = ""
substrate["create_spec"]["resources"]["storage_profile"]["image_details"]["publisher"] = ""
substrate["create_spec"]["resources"]["storage_profile"]["image_details"]["offer"] = ""
substrate["create_spec"]["resources"]["storage_profile"]["image_details"]["version"] = ""
substrate["create_spec"]["resources"]["storage_profile"]["image_details"]["source_image_id"] = ""
substrate["create_spec"]["resources"]["storage_profile"]["image_details"]["source_image_type"] = ""
substrate["create_spec"]["resources"]["storage_profile"]["image_details"]["type"] = ""
#for disk in substrate["create_spec"]["resources"]["storage_profile"]["data_disk_list"]:
# disk["lun"] = None
# disk["size_in_gb"] = None
# disk["name"] = ""
for nic in substrate["create_spec"]["resources"]["nw_profile"]["nic_list"]:
nic["nsg_name"] = ""
nic["vnet_name"] = ""
nic["subnet_id"] = ""
nic["nsg_id"] = ""
nic["private_ip_info"]["ip_address"] = ""
nic["private_ip_info"]["type"] = ""
nic["nic_name"] = ""
nic["subnet_name"] = ""
nic["vnet_id"] = ""
nic["type"] = ""
nic["public_ip_info"] = None
substrate["create_spec"]["resources"]["resource_group"] = ""
substrate["create_spec"]["resources"]["hw_profile"]["max_data_disk_count"] = 0
substrate["create_spec"]["resources"]["hw_profile"]["vm_size"] = ""
substrate["create_spec"]["resources"]["location"] = ""
substrate["create_spec"]["resources"]["availability_set_id"] = ""
substrate["create_spec"]["resources"]["account_uuid"] = ""
return bp_spec

### --------------------------------------------------------------------------------- ###
Expand Down
Loading