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.63k stars 833 forks source link

Creating VMs in Azure using the GoSDK #780

Closed pitthu closed 7 years ago

pitthu commented 7 years ago

We have a question on creating VM in Azure.

We are trying to create a VM using the go sdk where we want to use our private linux image.

The Image parameters that Azure needs are Publisher, sku, offer and version and uses them to get the image from the marketplace.

What values will we need for our private image to be passed in the vmClient.CreateOrUpdate function?

type ImageReference struct {   ID        string json:"id,omitempty"   Publisher string json:"publisher,omitempty"   Offer     string json:"offer,omitempty"   Sku       string json:"sku,omitempty"   Version   *string json:"version,omitempty"   }

Is there a way to pass just the vmName?

`

marstr commented 7 years ago

Howdy @pitthu, sorry this has gone without a response for a few weeks!

My colleague @devigned actually just finished updating the sample for managing virtual machines to include dealing with private images. You can find that code here: https://github.com/devigned/virtual-machines-go-manage/blob/image-ref-update/example.go

It hasn't made it's way into the main Azure-Sample repository yet, but rest assured that it will.

I hope that helps!

-Martin

pitthu commented 7 years ago

Hi Martin,

Thanks for replying. We have been in contact with David, he has helped a lot with the create instance :)

Best, Sunanda

On Thu, Oct 12, 2017 at 3:25 PM, Martin Strobel notifications@github.com wrote:

Howdy @pitthu https://github.com/pitthu, sorry this has gone without a response for a few weeks!

My colleague @devigned https://github.com/devigned actually just finished updating the sample for managing virtual machines to include dealing with private images. You can find that code here: https://github.com/devigned/virtual-machines-go-manage/ blob/image-ref-update/example.go

It hasn't made it's way into the main Azure-Sample repository https://github.com/Azure-Samples?utf8=%E2%9C%93&q=&type=&language=go yet, but rest assured that it will.

I hope that helps!

-Martin

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Azure/azure-sdk-for-go/issues/780#issuecomment-336294045, or mute the thread https://github.com/notifications/unsubscribe-auth/AGl3i3ZnJFYEIaySuYXHW4xcHINdqH0Jks5srpHYgaJpZM4Pf03C .