Repository: skypilot-org/skypilot
Pull request: Add instructions in document for quota increase
To close https://github.com/sky-proj/sky/issues/524, https://github.com/sky-proj/sky/issues/513. We might also explore CLI interface to query quotas for convenience as mentioned in https://github.com/sky-proj/sky/issues/447. Curious what people think.

Problem statement:
Docs: Add instructions for quota requests on all clouds
By default, accounts on all three clouds are not granted quotas for high end GPU instances such as V100. Let's write a clean guideline for users on how to submit quota requests.

Hints from issue discussion:

Commit message: Add hint for azure subscriptions

Patch to review:
diff --git a/docs/source/getting-started/installation.rst b/docs/source/getting-started/installation.rst
index 96f8e17be41..2050d080b9a 100644
--- a/docs/source/getting-started/installation.rst
+++ b/docs/source/getting-started/installation.rst
@@ -63,6 +63,8 @@ If running :code:`conda install -c conda-forge google-cloud-sdk` produces the er
   $ # Set the subscription to use
   $ az account set -s <subscription_id>
 
+Hint: run ``az account subscription list`` to get a list of subscription IDs under your account.
+
 **Verifying cloud setup**
 
 After configuring the desired clouds, you can optionally run :code:`sky check` to verify that credentials are correctly set up:
diff --git a/docs/source/index.rst b/docs/source/index.rst
index 7cfb0b6c8a0..b1c48cc4834 100644
--- a/docs/source/index.rst
+++ b/docs/source/index.rst
@@ -59,6 +59,12 @@ Key features:
    .. reference/optimizer
    .. reference/service-catalog
 
+.. toctree::
+   :maxdepth: 1
+   :caption: Reference
+
+   reference/quota
+
 
 .. .. toctree::
 ..   :maxdepth: 1
diff --git a/docs/source/reference/quota.rst b/docs/source/reference/quota.rst
new file mode 100644
index 00000000000..21c63d1b998
--- /dev/null
+++ b/docs/source/reference/quota.rst
@@ -0,0 +1,46 @@
+.. _quota:
+Quota Increase
+==================
+
+
+Most cloud providers enforce a quota policy to limit the number of VM instances that can exist in a given region.
+Users may encourter `QuotaExceeded` or `VcpuLimitExceeded` errors during resources provisioning, especially for high end GPUs such as V100/A100.
+To check or increase your quota limits, please follow the below instructions.
+After submitting the request, it will usually take a few days for the support team to review.
+To increase chances of being approved, you may respond their inquiry emails on how the requested resources will be used your projects. 
+
+AWS
+-------------------------------
+
+1. Go to the `EC2 Quotas console <https://console.aws.amazon.com/servicequotas/home/services/ec2/quotas>`_.
+2. **Select a region** on the top right.
+3. Choose an EC2 instance type from the list (e.g, ``Running On-Demand P instances``). You may check `here <https://aws.amazon.com/ec2/instance-types/>`_ for more instance types.
+4. Click the instance name, and then choose **Request quota increase**.
+5. For **Change quota value**, enter the new value.
+6. Choose **Request**.
+
+Azure
+-------------------------------
+
+1. First go to Azure's `quota <https://portal.azure.com/#blade/Microsoft_Azure_Capacity/QuotaMenuBlade/myQuotas>`_ page.
+2. Select **Request Increase** near the top of the screen.
+3. For Quota type, select ``Compute-VM (cores-vCPUs) subscription limit increases``.
+4. Select **Next** to go to the Additional details screen, then select **Enter details**.
+  - In the Quota details screen:
+  - For Deployment model, ensure **Resource Manager** is selected.
+  - For Locations, select all regions in which you want to increase quotas.
+  - For each region you selected, select one or more VM series from the Quotas drop-down list.
+  - For each VM Series you selected (e.g., ``NCSv3``, ``NDv2`` for V100 instances), enter the new vCPU limit that you want for this subscription. You may check `here <https://docs.microsoft.com/en-us/azure/virtual-machines/sizes-gpu>`_ for more VM Series.
+  - When you're finished, select **Save and continue**.
+5. Enter or confirm your contact details, then select **Next**.
+6. Finally, ensure that everything looks correct on the Review + create page, then select **Create** to submit your request.
+
+GCP
+-------------------------------
+
+1. In the Google Cloud Console, go to the `Quota <https://console.cloud.google.com/iam-admin/quotas/>`_ page.
+2. Click **Filter** and select ``Service: Compute Engine API``.
+3. Choose ``Limit Name: instance_name``. (e.g., ``NVIDIA-V100-GPUS-per-project-region``). You may check `here <https://cloud.google.com/compute/quotas#gpu_quota>`_ for a complete GPU list. 
+4. Select the checkbox of the region whose quota you want to change.
+5. Click **Edit Quotas** and fill out the new limit.
+6. Click **Submit Request**.
\ No newline at end of file


Code review comments:
diff_hunk: @@ -0,0 +1,46 @@
+.. _quota:
+Quota Increase
+==================
+
+
+Most cloud providers enforce a quota policy to limit the number of VM instances that can exist in a given region.
+Users may encourter `QuotaExceeded` or `VcpuLimitExceeded` errors during resources provisioning, especially for high end GPUs such as V100/A100.
+To check or increase your quota limits, please follow the below instructions.
+After submitting the request, it will usually take a few days for the support team to review.
+To increase chances of being approved, you may respond their inquiry emails on how the requested resources will be used your projects. 
+
+AWS
+-------------------------------
+
+1. Go to the `EC2 Quotas console <https://console.aws.amazon.com/servicequotas/home/services/ec2/quotas>`_.
+2. **Select a region** on the top right.
+3. Choose an EC2 instance type from the list (e.g, ``Running On-Demand P instances``). You may check `here <https://aws.amazon.com/ec2/instance-types/>`_ for more instance types.
+4. Click the instance name, and then choose **Request quota increase**.
path: docs/source/reference/quota.rst
text: @user1:
instance name -> quota name

diff_hunk: @@ -59,6 +59,12 @@ Key features:
    .. reference/optimizer
    .. reference/service-catalog
 
+.. toctree::
path: docs/source/index.rst
text: @user1:
How about renaming L47 from Features to "User Guides", and put quota in that section?  Seems weird to have a standalone section just for quota.

diff_hunk: @@ -0,0 +1,46 @@
+.. _quota:
+Quota Increase
+==================
+
+
+Most cloud providers enforce a quota policy to limit the number of VM instances that can exist in a given region.
+Users may encourter `QuotaExceeded` or `VcpuLimitExceeded` errors during resources provisioning, especially for high end GPUs such as V100/A100.
+To check or increase your quota limits, please follow the below instructions.
+After submitting the request, it will usually take a few days for the support team to review.
+To increase chances of being approved, you may respond their inquiry emails on how the requested resources will be used your projects. 
+
+AWS
+-------------------------------
+
+1. Go to the `EC2 Quotas console <https://console.aws.amazon.com/servicequotas/home/services/ec2/quotas>`_.
+2. **Select a region** on the top right.
+3. Choose an EC2 instance type from the list (e.g, ``Running On-Demand P instances``). You may check `here <https://aws.amazon.com/ec2/instance-types/>`_ for more instance types.
+4. Click the instance name, and then choose **Request quota increase**.
+5. For **Change quota value**, enter the new value.
+6. Choose **Request**.
+
+Azure
+-------------------------------
+
+1. First go to Azure's `quota <https://portal.azure.com/#blade/Microsoft_Azure_Capacity/QuotaMenuBlade/myQuotas>`_ page.
+2. Select **Request Increase** near the top of the screen.
+3. For Quota type, select ``Compute-VM (cores-vCPUs) subscription limit increases``.
path: docs/source/reference/quota.rst
text: @user1:
After doing step 3, a message pops us:
```
Get more quota now. You don’t need a support ticket to get more quota. Select Manage Quota to increase quota instantly.
[Learn more](https://docs.microsoft.com/azure/azure-portal/supportability/per-vm-quota-requests?WT.mc_id=Portal-Microsoft_Azure_Support)
```
with a button "Manage Quota" that takes me to another quota page.

Is it intentional that the user shouldn't do that?  If so, best to say something like ignore that button and click Next anyway. If not, maybe try that page too?

@author:
Yeah.. the "Manage Quota" stuff doesn't work for most GPU instances. The request will be rejected and users will be redirected back to create support tickets later so we don't want to recommend this way. I've added some explanation in the doc.

diff_hunk: @@ -0,0 +1,46 @@
+.. _quota:
+Quota Increase
+==================
+
+
+Most cloud providers enforce a quota policy to limit the number of VM instances that can exist in a given region.
+Users may encourter `QuotaExceeded` or `VcpuLimitExceeded` errors during resources provisioning, especially for high end GPUs such as V100/A100.
+To check or increase your quota limits, please follow the below instructions.
+After submitting the request, it will usually take a few days for the support team to review.
+To increase chances of being approved, you may respond their inquiry emails on how the requested resources will be used your projects. 
+
+AWS
+-------------------------------
+
+1. Go to the `EC2 Quotas console <https://console.aws.amazon.com/servicequotas/home/services/ec2/quotas>`_.
+2. **Select a region** on the top right.
+3. Choose an EC2 instance type from the list (e.g, ``Running On-Demand P instances``). You may check `here <https://aws.amazon.com/ec2/instance-types/>`_ for more instance types.
path: docs/source/reference/quota.rst
text: @user1:
For future: it'd be really nice to fix the --cloud flag to show the instance types:
```
sky show-gpus --cloud aws
NVIDIA_GPU  AVAILABLE_QUANTITIES
V100        1, 4, 8
V100-32GB   8
A100        8
K80         1, 8, 16
T4          1, 4, 8
M60         1, 2, 4
```
This way users can quickly know what to request.

@author:
Good idea. I think we can add one column to our service catalog for associated instance types and list them there.

@author:
Right now users may tell it from the `INSTANCE_TYPE` info in `sky show-gpus --cloud aws --all`.

```
GPU  QTY  CLOUD  INSTANCE_TYPE  HOST_MEMORY  HOURLY_PRICE  HOURLY_SPOT_PRICE  
K80  1    AWS    p2.xlarge      61GB         $ 0.900       $ 0.270            
K80  8    AWS    p2.8xlarge     488GB        $ 7.200       $ 2.160            
K80  16   AWS    p2.16xlarge    732GB        $ 14.400      $ 4.320            
```

@user1:
Nice, add `sky show-gpus --cloud aws --all` as a hint here?