Documentation
¶
Index ¶
- Variables
- func FilterComputeSizesByDiskControllerType(ctx context.Context, location *string, computeSizes []string, ...) ([]string, error)
- func FilterNoLocalStorageSizes(ctx context.Context, computeSizes []string) ([]string, error)
- func FilterVMSizeOfferedByLocation(ctx context.Context, vmSizes []string, location string) ([]string, error)
- func GetSharedImage(ctx context.Context, id *string) (*armcompute.GalleryImageVersionsClientGetResponse, error)
- func GetSharedImageDiskControllerTypes(ctx context.Context, id *string) ([]string, error)
- func IsImageOffered(ctx context.Context, req ImageRequest) error
- func IsVMSizeOfferedByLocation(ctx context.Context, vmSize, location string) (bool, error)
- func Locations(ctx context.Context) ([]string, error)
- func LocationsBySupportedResourceType(ctx context.Context, rt ResourceType) ([]string, error)
- func SkuG2Support(ctx context.Context, location string, publisher string, offer string, ...) (string, error)
- func SpotInfo(mCtx *mc.Context, args *SpotInfoArgs) (*spot.SpotResults, error)
- func SubscriptionID() string
- type ComputeSelector
- type ImageReference
- type ImageRequest
- type OSType
- type ResourceType
- type SpotInfoArgs
- type SpotInfoResult
- type SpotSelector
Constants ¶
This section is empty.
Variables ¶
var (
FedoraDefaultVersion string = "43"
)
Functions ¶
func FilterComputeSizesByDiskControllerType ¶ added in v0.14.1
func FilterComputeSizesByDiskControllerType(ctx context.Context, location *string, computeSizes []string, requiredType string) ([]string, error)
FilterComputeSizesByDiskControllerType returns the subset of computeSizes that are available in location AND support requiredType. Sizes without a DiskControllerTypes capability are assumed to support only SCSI (Azure historical default).
func FilterNoLocalStorageSizes ¶ added in v0.14.1
FilterNoLocalStorageSizes returns only the sizes from computeSizes that have no NVMe-only local storage (L-series). Temp disks (MaxResourceVolumeMB > 0) are allowed — they are ephemeral scratch space that does not interfere with RHEL AI's OS disk. Sizes not found in the Azure SKU catalog (typo or restricted SKU) are logged as warnings and excluded.
func FilterVMSizeOfferedByLocation ¶ added in v0.8.2
func FilterVMSizeOfferedByLocation(ctx context.Context, vmSizes []string, location string) ([]string, error)
Get InstanceTypes offerings on current location
func GetSharedImage ¶ added in v0.10.0
func GetSharedImage(ctx context.Context, id *string) (*armcompute.GalleryImageVersionsClientGetResponse, error)
func GetSharedImageDiskControllerTypes ¶ added in v0.14.1
GetSharedImageDiskControllerTypes returns the disk controller types listed in the gallery image definition's features (e.g. ["SCSI"] for RHEL AI images). Returns nil when the feature is absent. Uses the gallery owner's subscription (parts[2] of the ARM resource ID) so the API path resolves to where the resource actually lives. The image ID must be a full ARM resource ID with 13 slash-separated parts.
func IsImageOffered ¶
func IsImageOffered(ctx context.Context, req ImageRequest) error
func IsVMSizeOfferedByLocation ¶ added in v0.8.2
func LocationsBySupportedResourceType ¶ added in v0.9.6
func LocationsBySupportedResourceType(ctx context.Context, rt ResourceType) ([]string, error)
func SkuG2Support ¶ added in v0.9.1
func SpotInfo ¶ added in v0.9.6
func SpotInfo(mCtx *mc.Context, args *SpotInfoArgs) (*spot.SpotResults, error)
This function will return the best spot option
func SubscriptionID ¶ added in v0.14.1
func SubscriptionID() string
SubscriptionID returns the Azure subscription ID, checking AZURE_SUBSCRIPTION_ID first, then falling back to ARM_SUBSCRIPTION_ID (Pulumi/Terraform convention).
Types ¶
type ComputeSelector ¶ added in v0.9.5
type ComputeSelector struct{}
func NewComputeSelector ¶ added in v0.9.5
func NewComputeSelector() *ComputeSelector
func (*ComputeSelector) Select ¶ added in v0.9.5
func (c *ComputeSelector) Select(ctx context.Context, args *cr.ComputeRequestArgs) ([]string, error)
type ImageReference ¶
type ImageReference struct {
// Market Place
Publisher string
Offer string
Sku string
// Community
CommunityImageID string
SharedImageID string
// Required disk controller type for this image (e.g. "SCSI", "NVMe").
// Empty means no specific requirement; Azure uses the VM size default.
DiskControllerType string
}
func GetImageRef ¶
func GetImageRef(osTarget OSType, arch string, version string) (*ImageReference, error)
version should came in format X.Y (major.minor)
type ImageRequest ¶
type ImageRequest struct {
Region string
ImageReference
}
type ResourceType ¶ added in v0.9.6
type ResourceType string
const ( RTPublicIPAddresses ResourceType = "publicIPAddresses" RTVirtualMachines ResourceType = "virtualMachines" )
type SpotInfoArgs ¶ added in v0.9.6
type SpotInfoResult ¶ added in v0.9.6
type SpotSelector ¶ added in v0.9.5
type SpotSelector struct{}
func NewSpotSelector ¶ added in v0.9.5
func NewSpotSelector() *SpotSelector
func (*SpotSelector) Select ¶ added in v0.9.5
func (c *SpotSelector) Select(mCtx *mc.Context, args *spot.SpotRequestArgs) (*spot.SpotResults, error)