GithubHelp home page GithubHelp logo

cyclecloud-marketplace-image's Introduction

Building a distributing a marketplace image for CycleCloud

Disclaimer

The scripts in this repository are provided "as is" without any support from Microsoft, or CycleCloud.

This only serves as an example of how to build a CycleCloud image with Packer.

See LICENSE for further information.

Introduction

The process for publishing a new image in Marketplace is:

  1. Create a VM with an attached managed disk and install CycleCloud into the disk
  2. Capture the VHD for the OS image and the managed disk
  3. Launch and test a new VM usig both VHDs
  4. Copy both VHDs to the storage account linked to the marketplace publisher account
  5. Go to the Cloud Partner Portal to update the artifact

The scripts in this repo use packer to build the images. These are then tested and the VHDs copied to the publishing storage account. The packer process, the deployment of the test VM, and the VHD transfer are scripted.

The Marketplace publishing guideline recommends that a separate subscription is used to hold the marketplace-linked VHDs, and that this subscription should not be used for anything else besides holding the storage account.

  • The PM subscription is used to build the packer image and testing
  • A separate marketplace subscription is used for the storage account

Pre-requisites

The scripts used require the following installed in your PATH

  1. jq
  2. packer
  3. az cli (logged in)
  4. Pogo credentials for both packer build VHD (this is in the PM subscription)
  5. Pogo credentials for the marketplace-linked storage account (this is in a separate subscription)

You should also have a config.json file in this directory. This json file has the following structure:

{
    "subscription_id": "PM-Subscription-Used-By-Packer", 
    "location": "eastus",
    "cyclecloud_installer_url": "https://cyclecloudarm.blob.core.windows.net/cyclecloudrelease",
    "cyclecloud_version": "7.6.0",
    "packer": {
        "executable": "packer"
    },
    "service_principal": {
        "name": "sp-usedby-packer-for-building-vm",
        "tenant_id":      "",
        "application_id": "",
        "password":       ""
    },
    "build": {
        "resource_group": "cyclecloud_mrktpl_image_builder",
        "storage_account": "cyclecloudimagebuilder",
        "blob_container": "imagevhds",
        "image_name": "centos75",
        "image_publisher": "OpenLogic",
        "image_offer": "CentOS",
        "image_sku": "7.5",
        "vm_size": "Standard_D2_v3"
    },
    "publish": {
        "resource_group": "cyclecloud_mrktpl_storage_account",
        "storage_account": "azurecyclecloudmrktpl",
        "image_container": "imagevhds",
        ""storage_key": "ACCESSKEY-For-StorageAccount",
    }
}

Steps

  1. Edit or create config.json
  • Replace cyclecloud_version with the version to be pushed
  • fill in the service principal used for the packer build
  • fill in the storage_key for the Marketplace Storage Account
  1. Run the build script. This launches the packer process

    ./build_image.sh
    
    • The script will output the OS_VHD_URL and DATA_VHD_URL
  2. Test the images using the VHD URLs:

The build script outputs the URLs for the VHDs. To test the VHDs, provide them as input to the test script: ./test_vhd.sh ${OS_VHD_URL} ${DATA_VHD_URL}

  1. Copy VHDs to azure marketplace storage account The target storage account is the one that is actually used for publishing. After verifying that the test VM using the VHD is working, copy it to the storage account for publishing:

    ./deploy_vhd.sh ${OS_VHD_URL} ${DATA_VHD_URL}
    
  2. Go to the publishing portal, update the SKU with a new version and VHD artifacts

  3. See CycleCloud Publishing for details on how to use the Marketplace Portal.

cyclecloud-marketplace-image's People

Contributors

atomic-penguin avatar bwatrous avatar jermth avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.