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

roachprod: add availability zone and network disk type support to azure #55775

Merged
merged 1 commit into from
Oct 21, 2020

Conversation

arulajmani
Copy link
Collaborator

User facing change:

  • New flag --azure-availability-zone lets the user supply which zone
    a VM should be provisioned in.
  • New flag --azure-network-disk-type lets the user choose which type
    of network disk to use (ultra-disk, premium-ssd)

Previously, we didn't allow users to decide which availability zone a
VM was provisioned in. To achieve this, this patch adds support for
Network Security Groups. This was required as we had to update the
IP SKU from Basic (which is now deprecated) to Standard. By default,
this SKU blocks all inbound/outbound communication, which needed to be
overriden by creating network security rules that allow HTTPS/SSH/HTTP
connections. Network Security Groups are created under the resource
groups that manage VNets for a particular location the first time a
VNet is created.

Release note: None

@cockroach-teamcity
Copy link
Member

This change is Reviewable

storageAccType = compute.StorageAccountTypesUltraSSDLRS
default:
err = errors.Newf("unsuported network disk type: %s", p.opts.networkDiskType)
return
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we keep default == premium-disk? Like it was before when not using SSD?

) (network.SecurityGroup, error) {
p.mu.Lock()
group, ok := p.mu.securityGroups[name]
p.mu.Unlock()
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this function get call from multiple threads? Looks like it is...
But then we release the lock, and proceed to create the group.. So, wouldn't we wind up creating multipole groups?
Should this be a defer p.mu.Unlock()?

p.mu.Lock()
group, ok := p.mu.resourceGroups[groupName]
group, ok := p.mu.resourceGroups[name]
Copy link
Contributor

Choose a reason for hiding this comment

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

same question re concurrence.

Copy link
Collaborator Author

@arulajmani arulajmani left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @arulajmani and @miretskiy)


pkg/cmd/roachprod/vm/azure/azure.go, line 597 at r1 (raw file):

Previously, miretskiy (Yevgeniy Miretskiy) wrote…

Should we keep default == premium-disk? Like it was before when not using SSD?

That is still the default behaviour when the user says --local-ssd = false (see the changes in flags.go). This is triggered if the user provides a value for --azure-network-disk-type that isn't premium-disk or ultra-disk -- in which case it makes sense to return an error to the user instead of swallowing the erroneous value and creating a premium disk underneath the hood.


pkg/cmd/roachprod/vm/azure/azure.go, line 679 at r1 (raw file):

Previously, miretskiy (Yevgeniy Miretskiy) wrote…

Does this function get call from multiple threads? Looks like it is...
But then we release the lock, and proceed to create the group.. So, wouldn't we wind up creating multipole groups?
Should this be a defer p.mu.Unlock()?

I'm honestly not sure about the flow of the code here and where/how this function can be called from multiple goroutines tbh. I just followed the pattern of the existing code in getResourceGroup, which didn't wrap the API calls to the client inside the mutex. Do you want me to switch it?

User facing change:
- New flag `--azure-availability-zone` lets the user supply which zone
a VM should be provisioned in.
- New flag `--azure-network-disk-type` lets the user choose which type
of network disk to use (ultra-disk, premium-ssd)

Previously, we didn't allow users to decide which availability zone a
VM was provisioned in. To achieve this, this patch adds support for
Network Security Groups. This was required as we had to update the
IP SKU from Basic (which is now deprecated) to Standard. By default,
this SKU blocks all inbound/outbound communication, which needed to be
overriden by creating network security rules that allow HTTPS/SSH/HTTP
connections. Network Security Groups are created under the resource
groups that manage VNets for a particular location the first time a
VNet is created.

Release note: None
Copy link
Contributor

@miretskiy miretskiy left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @arulajmani and @miretskiy)


pkg/cmd/roachprod/vm/azure/azure.go, line 597 at r1 (raw file):

Previously, arulajmani (Arul Ajmani) wrote…

That is still the default behaviour when the user says --local-ssd = false (see the changes in flags.go). This is triggered if the user provides a value for --azure-network-disk-type that isn't premium-disk or ultra-disk -- in which case it makes sense to return an error to the user instead of swallowing the erroneous value and creating a premium disk underneath the hood.

ack.


pkg/cmd/roachprod/vm/azure/azure.go, line 679 at r1 (raw file):

Previously, arulajmani (Arul Ajmani) wrote…

I'm honestly not sure about the flow of the code here and where/how this function can be called from multiple goroutines tbh. I just followed the pattern of the existing code in getResourceGroup, which didn't wrap the API calls to the client inside the mutex. Do you want me to switch it?

sounds good

@miretskiy miretskiy self-requested a review October 21, 2020 17:47
@arulajmani
Copy link
Collaborator Author

TFTR!

bors r=miretskiy

@craig
Copy link
Contributor

craig bot commented Oct 21, 2020

Build succeeded:

@craig craig bot merged commit a180d34 into cockroachdb:master Oct 21, 2020
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.

3 participants