本文整理汇总了Golang中github.com/Azure/azure-sdk-for-go/management/virtualmachine.Role.OSVirtualHardDisk方法的典型用法代码示例。如果您正苦于以下问题:Golang Role.OSVirtualHardDisk方法的具体用法?Golang Role.OSVirtualHardDisk怎么用?Golang Role.OSVirtualHardDisk使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/Azure/azure-sdk-for-go/management/virtualmachine.Role
的用法示例。
在下文中一共展示了Role.OSVirtualHardDisk方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: ConfigureDeploymentFromExistingOSDisk
// ConfigureDeploymentFromExistingOSDisk configures VM Role to deploy from an
// existing disk. 'label' is optional.
func ConfigureDeploymentFromExistingOSDisk(role *vm.Role, osDiskName, label string) error {
role.OSVirtualHardDisk = &vm.OSVirtualHardDisk{
DiskName: osDiskName,
DiskLabel: label,
}
return nil
}
示例2: ConfigureDeploymentFromPlatformImage
// ConfigureDeploymentFromPlatformImage configures VM Role to deploy from a
// platform image. See osimage package for methods to retrieve a list of the
// available platform images. "label" is optional.
func ConfigureDeploymentFromPlatformImage(
role *vm.Role,
imageName string,
mediaLink string,
label string) error {
if role == nil {
return fmt.Errorf(errParamNotSpecified, "role")
}
role.OSVirtualHardDisk = &vm.OSVirtualHardDisk{
SourceImageName: imageName,
MediaLink: mediaLink,
}
return nil
}
示例3: ConfigureDeploymentFromRemoteImage
// ConfigureDeploymentFromRemoteImage configures VM Role to deploy from a remote
// image source. "remoteImageSourceURL" can be any publically accessible URL to
// a VHD file, including but not limited to a SAS Azure Storage blob url. "os"
// needs to be either "Linux" or "Windows". "label" is optional.
func ConfigureDeploymentFromRemoteImage(
role *vm.Role,
remoteImageSourceURL string,
os string,
newDiskName string,
destinationVhdStorageURL string,
label string) error {
if role == nil {
return fmt.Errorf(errParamNotSpecified, "role")
}
role.OSVirtualHardDisk = &vm.OSVirtualHardDisk{
RemoteSourceImageLink: remoteImageSourceURL,
MediaLink: destinationVhdStorageURL,
DiskName: newDiskName,
OS: os,
DiskLabel: label,
}
return nil
}