Azure / azure-sdk-for-go

This repository is for active development of the Azure SDK for Go. For consumers of the SDK we recommend visiting our public developer docs at:
https://docs.microsoft.com/azure/developer/go/
MIT License
1.61k stars 822 forks source link

VMMarketplaceInvalidInput using a marketplace image #13894

Closed DavidGOrtega closed 3 years ago

DavidGOrtega commented 3 years ago

👋 Hi there! Im running into an issue, I have googled, looked all the examples, etc... but I might have overlooked how to setup this. Any help will be truly appreciated

Bug Report

Error: cannot create vm: Code="VMMarketplaceInvalidInput" Message="Creating a virtual machine from Marketplace image or a custom image sourced from a Marketplace image requires Plan information in the request. VM: '/subscriptions/cee76754-ef49-49f7-b371-f6841fa82182/resourceGroups/iterative-haNQPkbDM/providers/Microsoft.Compute/virtualMachines/iterative-haNQPkbDM'."
"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute"
"github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-11-01/network"
"github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources"

When trying to setup a marketplace image

              compute.VirtualMachine{
            Location: to.StringPtr(region),
            VirtualMachineProperties: &compute.VirtualMachineProperties{
                HardwareProfile: &compute.HardwareProfile{
                    VMSize: compute.VirtualMachineSizeTypes(instanceType),
                },
                StorageProfile: &compute.StorageProfile{
                    ImageReference: &compute.ImageReference{
                        Publisher: to.StringPtr(publisher),
                        Offer:     to.StringPtr(offer),
                        Sku:       to.StringPtr(sku),
                        Version:   to.StringPtr(version),

seems that Im missing something regarding to a plan. The image that I want to setup is nvidia:tensorflow_from_nvidia:tensorflow_nvidia_20_03_1:20.03.1

I am able to create my vm with current code with the image Canonical:UbuntuServer:18.04-LTS:latest without any issues.

ArcturusZhang commented 3 years ago

Hi @DavidGOrtega thanks for this issue!

Some market images require a plan block, this is a requirement from the service itself.

DavidGOrtega commented 3 years ago

👋 @ArcturusZhang

I tried it also without any luck

Plan: &compute.Plan{
                    Name:      to.StringPtr(sku),
                    Publisher: to.StringPtr(publisher),
                    Product:   to.StringPtr(offer),
                },

Seems that I have to accept the agreement somehow.

ArcturusZhang commented 3 years ago

Hey @DavidGOrtega sorry things do not work, but this is not something wrong with the SDK itself. As far as I know, they did not provide a function or something in the SDK to let you could accept the agreement - you will have to do it on the portal and then go back to your code. But I do not know much about the detail of this. Therefore I have tagged this issue so that someone from the service team will take a look at this issue and then give you some official answer/solution on this issue.

ghost commented 3 years ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @Drewm3, @avirishuv.

Issue Details
👋 Hi there! Im running into an issue, I have googled, looked all the examples, etc... but I might have overlooked how to setup this. Any help will be truly appreciated ### Bug Report ```sh Error: cannot create vm: Code="VMMarketplaceInvalidInput" Message="Creating a virtual machine from Marketplace image or a custom image sourced from a Marketplace image requires Plan information in the request. VM: '/subscriptions/cee76754-ef49-49f7-b371-f6841fa82182/resourceGroups/iterative-haNQPkbDM/providers/Microsoft.Compute/virtualMachines/iterative-haNQPkbDM'." ``` ```go "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute" "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-11-01/network" "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources" ``` When trying to setup a marketplace image ```go compute.VirtualMachine{ Location: to.StringPtr(region), VirtualMachineProperties: &compute.VirtualMachineProperties{ HardwareProfile: &compute.HardwareProfile{ VMSize: compute.VirtualMachineSizeTypes(instanceType), }, StorageProfile: &compute.StorageProfile{ ImageReference: &compute.ImageReference{ Publisher: to.StringPtr(publisher), Offer: to.StringPtr(offer), Sku: to.StringPtr(sku), Version: to.StringPtr(version), ``` seems that Im missing something regarding to a plan. The image that I want to setup is ```nvidia:tensorflow_from_nvidia:tensorflow_nvidia_20_03_1:20.03.1``` I am able to create my vm with current code with the image ```Canonical:UbuntuServer:18.04-LTS:latest``` without any issues.
Author: DavidGOrtega
Assignees: -
Labels: `Compute - VM`, `Service Attention`, `customer-reported`, `question`
Milestone: -
avirishuv commented 3 years ago

Assigning to @axayjo for taking a look at the issue.

amjads1 commented 3 years ago

@ArcturusZhang Considering on-going holidays, hoping to get an update in the first week of Jan.

DavidGOrtega commented 3 years ago

Thanks guys for the effort. Merry Christmas!

github-2407 commented 3 years ago

@DavidGOrtega , have you tried this to accept the terms and agreement? https://docs.microsoft.com/en-us/cli/azure/vm/image/terms?view=azure-cli-latest

Drewm3 commented 3 years ago

Hi @DavidGOrtega, could you please try the suggestion from @github-2407 and let us know if that resolves the issue.

DavidGOrtega commented 3 years ago

@Drewm3 @github-2407 I tried to do that with this SDK without any luck and unfortunately I was not able to find an example or unit test to figure out what was wrong. Would you recommend me to read the code of azure-cli to figure it in go?

kriti-ms commented 3 years ago

@DavidGOrtega here's the REST API to get and sign the agreement https://docs.microsoft.com/en-us/rest/api/marketplaceordering/marketplaceagreements/get. Does this work for you? If not, can you share the error?

pranavperfect commented 3 years ago

I've leveraged the "Get-AzMarketPlaceTerms" module to get and then eventually accept the terms. I'm still getting the invalid input error.

The part number in the purchase information for VM '<> is not as expected. Beware that the Plan object's properties are case-sensitive. '

I use the command Set-AzVMPlan -Name "netgate-pfsense-plus-azure-2102" -Product "netgate-pfsense-azure-245-1" -Publisher "netgate" to set the plan information.

If deploying an image from Azure Portal, the same information, in the same case is displayed. Where am I going wrong?

axayjo commented 3 years ago

@kriti-ms do you know the resolution for the issue @pranavperfect is facing?

github-2407 commented 3 years ago

+@Amjad @.***> FYI

Adding @Oren @.> and @Guy @.> to help with the thread - VMMarketplaceInvalidInput using a marketplace image Issue #13894 Azure/azure-sdk-for-go (github.com)https://github.com/Azure/azure-sdk-for-go/issues/13894

From: Akshay Joshi @.> Sent: Thursday, April 29, 2021 2:19 PM To: Azure/azure-sdk-for-go @.> Cc: Kriti Shah @.>; Mention @.> Subject: Re: [Azure/azure-sdk-for-go] VMMarketplaceInvalidInput using a marketplace image (#13894)

@kriti-mshttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fkriti-ms&data=04%7C01%7CKriti.Shah%40microsoft.com%7C6798efc955e844c90c8508d90b54702d%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637553279555522864%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=wZhh1eU4nMrQsECm7SwCte5A%2BZbJqvMLtvw1Ab%2Bf%2B48%3D&reserved=0 do you know the resolution for the issue @pranavperfecthttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fpranavperfect&data=04%7C01%7CKriti.Shah%40microsoft.com%7C6798efc955e844c90c8508d90b54702d%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637553279555532860%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=LZC3E%2Bfwe6XCwekbLjoopUmkxwdo0y%2Bs5jzfInVnXFU%3D&reserved=0 is facing?

- You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FAzure%2Fazure-sdk-for-go%2Fissues%2F13894%23issuecomment-829603242&data=04%7C01%7CKriti.Shah%40microsoft.com%7C6798efc955e844c90c8508d90b54702d%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637553279555542859%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=qlyk8s2m1oyNhVtR52hygrshsfL8vA8wl6xoBL54aHE%3D&reserved=0, or unsubscribehttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FANOBRNZ2OBJGNYAFSRDRH7DTLHENDANCNFSM4UPP33NA&data=04%7C01%7CKriti.Shah%40microsoft.com%7C6798efc955e844c90c8508d90b54702d%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637553279555542859%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=e4ifbhORwE51hP1sw8H%2B0g37n91aKeI2pOOuxsFh4rE%3D&reserved=0.

github-2407 commented 3 years ago

You need to make sure the ImageReferance and the Plan object are pointing the same offer, the in the original question ImageReferance is: nvidia:tensorflow_from_nvidia:tensorflow_nvidia_20_03_1:20.03.1

But the plan object is Set-AzVMPlan -Name "netgate-pfsense-plus-azure-2102" -Product "netgate-pfsense-azure-245-1" -Publisher "netgate"

If you can share the ARM template generated by this code it will be easier to evaluate

From: Kriti Shah @.> Sent: Saturday, May 1, 2021 7:42 PM To: Azure/azure-sdk-for-go @.>; Azure/azure-sdk-for-go @.>; Oren Maoz @.>; Guy Shuchman @.>; Amjad Shaik @.> Cc: Mention @.***> Subject: RE: [Azure/azure-sdk-for-go] VMMarketplaceInvalidInput using a marketplace image (#13894)

+@Amjad @.***> FYI

Adding @Oren @.> and @Guy @.> to help with the thread - VMMarketplaceInvalidInput using a marketplace image Issue #13894 Azure/azure-sdk-for-go (github.com)https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FAzure%2Fazure-sdk-for-go%2Fissues%2F13894&data=04%7C01%7COren.Maoz%40microsoft.com%7Cc8574e5fabcc4c3f169b08d90cc01755%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637554841472139403%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=gjeQpQItJUbVfn0gw7dQREjxKrhBEaCW6RuFVyEUhgM%3D&reserved=0

From: Akshay Joshi @.**@.>> Sent: Thursday, April 29, 2021 2:19 PM To: Azure/azure-sdk-for-go @.**@.>> Cc: Kriti Shah @.**@.>>; Mention @.**@.>> Subject: Re: [Azure/azure-sdk-for-go] VMMarketplaceInvalidInput using a marketplace image (#13894)

@kriti-mshttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fkriti-ms&data=04%7C01%7COren.Maoz%40microsoft.com%7Cc8574e5fabcc4c3f169b08d90cc01755%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637554841472139403%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=JK26zqGVQpewU9%2B919CCvVBmfJrzioo8XZkG6dL2UOQ%3D&reserved=0 do you know the resolution for the issue @pranavperfecthttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fpranavperfect&data=04%7C01%7COren.Maoz%40microsoft.com%7Cc8574e5fabcc4c3f169b08d90cc01755%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637554841472149357%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=bIyBUrlrJR5iPNs4eOL6PlE4jInriGe4uf21RhZq1BE%3D&reserved=0 is facing?

- You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FAzure%2Fazure-sdk-for-go%2Fissues%2F13894%23issuecomment-829603242&data=04%7C01%7COren.Maoz%40microsoft.com%7Cc8574e5fabcc4c3f169b08d90cc01755%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637554841472159310%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=nkVBKFzPFPn%2FEXKH7U0WUjvICXqiNVDF0ULFzBY%2Bdbw%3D&reserved=0, or unsubscribehttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FANOBRNZ2OBJGNYAFSRDRH7DTLHENDANCNFSM4UPP33NA&data=04%7C01%7COren.Maoz%40microsoft.com%7Cc8574e5fabcc4c3f169b08d90cc01755%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637554841472159310%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=wFn3%2BfxY5ja41uM25%2FhtPmkBIv80WLNzfMfuGZCbke0%3D&reserved=0.

axayjo commented 3 years ago

There's been no engagement on this thread for over 30 days. Closing this assuming the issue has been resolved. Please feel free to reopen the issue in case this warrants further discussion.