<p>I am doing a cluster backup and restore from GCP to Azure using <a href="https://github.com/vmware-tanzu/velero" rel="nofollow noreferrer">Velero</a></p>

<p>The persistent volumes in k8s have <code>NodeAffinity</code> which has the zone and region selectors that don't match with the lables on the Azure node, because of the difference in zones/regions of the two GCP providers.</p>

<p>e.g. the following labels on nodes
GCP</p>

<pre><code>failure-domain.beta.kubernetes.io/region=australia-southeast1
failure-domain.beta.kubernetes.io/zone=australia-southeast1-a
</code></pre>

<p>and on Azure</p>

<pre><code>failure-domain.beta.kubernetes.io/region=australiaeast
failure-domain.beta.kubernetes.io/zone=1
</code></pre>

<p>So, I tried to create a <code>storage-class</code> in Azure like the following:</p>

<pre><code>kind: StorageClass
apiVersion: storage.k8s.io/v1beta1
metadata:
  name: fast-azure
provisioner: kubernetes.io/azure-disk
allowVolumeExpansion: true
parameters:
  cachingmode: ReadOnly
  kind: Managed
  storageaccounttype: Premium_LRS
volumeBindingMode: WaitForFirstConsumer
allowedTopologies:
- matchLabelExpressions:
  - key: failure-domain.beta.kubernetes.io/zone
    values:
    - "1"
  - key: failure-domain.beta.kubernetes.io/region
    values:
    - australiaeast
</code></pre>

<p>But when I try to create a PVC using this storage class, I get the following error:</p>

<pre><code>arning  ProvisioningFailed    1s (x6 over 29s)   persistentvolume-controller  Failed to provision volume with StorageClass "fast-azure": compute.DisksClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="InvalidAvailabilityZone" Message="The zone(s) '' for resource 'Microsoft.Compute/disks/kubernetes-dynamic-pvc-105101ea-2c58-4a5a-8eeb-386c7489b782' is not supported. The supported zones for location 'australiaeast' are '1,2,3'"
</code></pre>

<p>Looks like it's reading a blank '' zone name. What's the correct way to write this storageclass for Azure?</p>

kosta
<p>Try the following. It worked for me.</p>
<pre><code>apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: azure-disk
parameters:
  cachingmode: None
  kind: Managed
  zoned: &quot;true&quot;
  storageaccounttype: Standard_LRS
provisioner: kubernetes.io/azure-disk
allowedTopologies:
- matchLabelExpressions:
  - key: failure-domain.beta.kubernetes.io/zone
    values:
    - australiaeast-1
</code></pre>
