Azure / azure-sdk-for-ruby

Ruby SDK for Azure Resource Manager: build and manage your Azure cloud infrastructure (Compute, Virtual Networks, Storage, etc...) using Ruby.
MIT License
275 stars 245 forks source link

Help creating a VM from a specialized image #2824

Closed chris1984 closed 1 year ago

chris1984 commented 3 years ago

Hi,

I am trying to create a VM from a specialized image and when the VM creation goes off, I get back the following:

"message": "MsRestAzure::AzureOperationError: InvalidParameter: Parameter 'osProfile' is not allowed."

Which I see from this:

If the image is not generalized, then you can't specify the osProfile (e.g. user/pass) because it already exists.

I see here though, that we need to use osProfile to create a VM:

https://github.com/Azure/azure-sdk-for-ruby/blob/master/management/azure_mgmt_compute/lib/2019-12-01/generated/azure_mgmt_compute/models/virtual_machine.rb#L36-L39

Is there a better way to accomplish this or is this a limitation of the SDK currently?

kairu-ms commented 3 years ago

I think you should use imageProfile to specify image. BTW, Ruby SDK is retired currently. It is recommended to use by rest-api. This is an example to show how to create an VM with specialized image. FRI

chris1984 commented 3 years ago

@kairu-ms thank you for the response. I will try that. I noticed in your link, the osProfile is still being sent off, won't this cause the error that I posted, or will it skip over that?

kairu-ms commented 3 years ago

@kairu-ms thank you for the response. I will try that. I noticed in your link, the osProfile is still being sent off, won't this cause the error that I posted, or will it skip over that?

No error was caused when I sent off osProfile.

kurtzeborn commented 1 year ago

Thank you for your interest in Azure SDKs. As detailed in this retirement announcement, this repo is no longer supported as of December 31st 2021. Please find the up-to-date list of languages and services supported with Azure SDKs here: https://aka.ms/azsdk