cockroach: github.com/cockroachdb/cockroach/pkg/cmd/roachprod/vm/azure Index | Files

package azure

import "github.com/cockroachdb/cockroach/pkg/cmd/roachprod/vm/azure"

Package azure allows roachprod to create instances within the Microsoft Azure cloud.

Much of the REST API code in this package is based off of https://github.com/Azure-Samples/azure-sdk-for-go-samples The API package is automatically generated from a REST API definition.

Azure terminology differs somewhat from GCP and AWS. The top-level container for resources and billing is is a "Subscription". All computational resources (VMs, IPs, network configs) belong to a "Resource Group", which lives in a particular "Location", such as "eastus", and which are roughly equivalent to other cloud provider's regions. Individual availability zones don't surface directly unless replica sets are used. Roachprod uses resource groups for lifecycle management, allowing all resources used by a cluster to be extended or deleted at once.

TODO(bob): Add support for deploying with replica sets.

The following resources are created for each cluster:

Roachprod "commons"
| Resource Group (one per Location / Region)
|   VNet          (10.<offset>/16)
|     Subnet      (10.<offset>/18 range)

Per cluster
| Resource Group (one per Location / Region)
|   []IPAddress   (public IP address for each VM)
|   []NIC         (bound to IPAddress and to a common Subnet)
|   []VM          (bound to a NIC)
|     OSDisk      (100GB, standard SSD storage)

Roachprod creates a "common" resource group, VNet, and Subnet for each location that clusters may be deployed into. Each NIC that is created will be bound to a common subnet. All of the managed VNets are peered together. This allows arbitrary connectivity between roachprod-managed clusters (e.g. to test cluster migration strategies).

Index

Package Files

auth.go azure.go doc.go flags.go ids.go

Constants

const (
    // ProviderName is "azure".
    ProviderName = "azure"
)

type Provider Uses

type Provider struct {
    // contains filtered or unexported fields
}

Provider implements the vm.Provider interface for the Microsoft Azure cloud.

func New Uses

func New() *Provider

New constructs a new Provider instance.

func (*Provider) Active Uses

func (p *Provider) Active() bool

Active implements vm.Provider and always returns true.

func (*Provider) CleanSSH Uses

func (p *Provider) CleanSSH() error

CleanSSH implements vm.Provider, is a no-op, and returns nil.

func (*Provider) ConfigSSH Uses

func (p *Provider) ConfigSSH() error

ConfigSSH implements vm.Provider, is a no-op, and returns nil. On Azure, the SSH public key is set as part of VM instance creation.

func (*Provider) Create Uses

func (p *Provider) Create(names []string, opts vm.CreateOpts) error

Create implements vm.Provider.

func (*Provider) Delete Uses

func (p *Provider) Delete(vms vm.List) error

Delete implements the vm.Provider interface.

func (*Provider) DeleteCluster Uses

func (p *Provider) DeleteCluster(name string) error

DeleteCluster implements the vm.DeleteCluster interface, providing a fast-path to tear down all resources associated with a cluster.

func (*Provider) Extend Uses

func (p *Provider) Extend(vms vm.List, lifetime time.Duration) error

Extend implements the vm.Provider interface.

func (*Provider) FindActiveAccount Uses

func (p *Provider) FindActiveAccount() (string, error)

FindActiveAccount implements vm.Provider.

func (*Provider) Flags Uses

func (p *Provider) Flags() vm.ProviderFlags

Flags implements the vm.Provider interface.

func (*Provider) List Uses

func (p *Provider) List() (vm.List, error)

List implements the vm.Provider interface. This will query all Azure VMs in the subscription and select those with a roachprod tag.

func (*Provider) Name Uses

func (p *Provider) Name() string

Name implements vm.Provider.

Package azure imports 27 packages (graph) and is imported by 1 packages. Updated 2020-06-10. Refresh now. Tools for package owners.