Class VMImageToImage

    • Method Detail

      • createMarketplacePlanIfPresent

        @Nullable
        public static Plan createMarketplacePlanIfPresent​(Image image,
                                                          AzureTemplateOptions templateOptions)
        In case that image is offered from Azure Marketplace then it requires to provide "Plan Information" (publisher/name/product) when creating VM from such an image. This method first tries to get this information from image but also allows to override those values by information passed in Azure template options (@see AzureTemplateOptions). In case there is used custom image which was created from Marketplace image then plan information is missing as this image cannot be referenced in format "location/publisher/offer/sku" from which Plan Information is normally parsed. In this case user can provide plan information (planPublisher/planName/planProduct) in template otherwise VM creation fails with error. It's allowed to override any of the original "image" plan information but only if those were present.
        Parameters:
        image - image
        templateOptions - Azure template options
        Returns:
        Plan Information (publisher, plan name, product) or null if any of publisher/name/product not defined