Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VirtualHardDisk Download and GalleryImage Create From OS Disk #249

Closed
wants to merge 4 commits into from

Conversation

damanMSFT
Copy link
Contributor

No description provided.

@@ -852,6 +852,8 @@ type GalleryImageProperties struct {
SourceType common.ImageSource `json:"sourceType,omitempty"`
// CloudInitDataSource - READ-ONLY; The cloud init data source to be used with the image. [NoCloud, Azure]. Default Value – NoCloud. For marketplace images it will be Azure.
CloudInitDataSource common.CloudInitDataSource `json:"cloudInitDataSource,omitempty"`
//Source VM to create the image from
SourceVM *string `json:"sourceVM,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@raghavendra-nataraj azure sdk does not provide an option to create a gallery image from a VM. So, what's the best way to handle this case?

@damanMSFT can we name this sourceVirtualMachine?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done locally. Pushing the changes in a bit.

@@ -40,6 +40,10 @@ type VirtualHardDiskProperties struct {
CloudInitDataSource common.CloudInitDataSource `json:"cloudInitDataSource,omitempty"`
// Container name
ContainerName *string `json:"containername,omitempty"`
// Source path for the VHD. Only supports url.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure how else I should add these properties. I don't think azure has a concept of downloading disk from somewhere like we are planning to do here.

@@ -74,3 +77,17 @@ func (c *VirtualHardDiskClient) Resize(ctx context.Context, group, container, na
func (c *VirtualHardDiskClient) Precheck(ctx context.Context, group, container string, vhds []*storage.VirtualHardDisk) (bool, error) {
return c.internal.Precheck(ctx, group, container, vhds)
}

func (c *VirtualHardDiskClient) DownloadVhdFromHttp(ctx context.Context, group, container, name string, storage *storage.VirtualHardDisk, azHttpImg *compute.AzureGalleryImageProperties) (*storage.VirtualHardDisk, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we call it UploadDiskFromHttp to keep it consistent with the GalleryImage API.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should keep it DownloadVhdFromHttp as we are actually performing a download here and not Upload. Also we should rename them to download as well in GalleryImage API to avoid confusion in a seperate PR. I don't think writing upload is the correct way here. Let me know your thoughts.

@@ -24,6 +24,7 @@ replace (
github.com/Azure/go-autorest v11.1.2+incompatible => github.com/Azure/go-autorest/autorest v0.10.0
github.com/dgrijalva/jwt-go => github.com/golang-jwt/jwt/v4 v4.1.0
github.com/gogo/protobuf => github.com/gogo/protobuf v1.3.2
github.com/microsoft/moc => ../moc
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you fix the path here to point to your change in moc repo on github. This doc describes how to do it.

https://msazure.visualstudio.com/msk8s/_wiki/wikis/msk8s.wiki/646685/Testing-dependent-PRs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure

@damanMSFT damanMSFT closed this Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants