Change:
Kubernetes version (use ): Client Version: version.Info{Major:"1", Minor:"6+", GitVersion:"v1.6.0-alpha.0.1011+", GitCommit:"", GitTreeState:"clean", BuildDate:"2016-11-30T07:19:12Z", GoVersion:"go1.6.2", Compiler:"gc", Platform:"linux/amd64"} Server Version: version.Info{Major:"1", Minor:"6+", GitVersion:"v1.6.0-alpha.0.1011+", GitCommit:"", GitTreeState:"clean", BuildDate:"2016-11-30T07:19:12Z", GoVersion:"go1.6.2", Compiler:"gc", Platform:"linux/amd64"} Environment: Cloud provider or hardware configuration: Azure OS (e.g. from /etc/os-release): RHEL 7.3 Install tools: Ansible What happened: PVC keeps pending with a new created storage account What you expected to happen: Storage class can find storage account and then create a dynamic pv for pvc to bind How to reproduce it (as minimally and precisely as possible): a new storage account without create any container a storage class as below a pvc annotating this storage class pvc status is pending Anything else do we need to know: After I create a new container "vhds" in storage account of "qewestus", storage class works and pvc is bound
VHD container is a rerequiste. Will update the doc.
.. I was about to open this exact bug. Shouldn't the provisoner create the vhds container ?
yes, there is a todo for this case (also missing storage account)
Another minor issue is, new volumes take a lot of time (tens of mins) to be ext4 formatted. This causes the pod to timeout and fail upon first use! Any way to make this better
fix is in
Can anyone share how to create the vhds container? For those that don't yet have this fix
Easiest is through the portal, browse to your storage account and create a container called
Thats great thanks for the quick response. The automator in me now wants to see if I can automate the creation of that container through powershell ;)
Does the container have to be of type 'Container' ? IE Full public read access??

Discussion:
"//pkg/cloudprovider:go_default_library", "//pkg/types:go_default_library", "//pkg/util/errors:go_default_library", <ins> "//pkg/volume:go_default_library", </ins> "//vendor:github.com/Azure/azure-sdk-for-go/arm/compute", "//vendor:github.com/Azure/azure-sdk-for-go/arm/network", "//vendor:github.com/Azure/azure-sdk-for-go/arm/storage",

import ( "fmt" "regexp" <ins> "strings" </ins> azs "github.com/Azure/azure-sdk-for-go/storage" )

name = name + ".vhd" err = blobClient.PutPageBlob(vhdContainerName, name, vhdSize, tags) if err != nil { <ins> // if container doesn't exist, create one and retry PutPageBlob detail := err.Error() if strings.Contains(detail, errContainerNotFound) { err = blobClient.CreateContainer(vhdContainerName, azs.ContainerAccessTypeContainer) if err == nil { err = blobClient.PutPageBlob(vhdContainerName, name, vhdSize, tags) } } } if err != nil { </ins> return "", "", fmt.Errorf("failed to put page blob: %v", err) } // add VHD signature to the blob h, err := createVHDHeader(uint64(size)) if err != nil {

"github.com/golang/glog" "k8s.io/kubernetes/pkg/cloudprovider" "k8s.io/kubernetes/pkg/types" <ins> "k8s.io/kubernetes/pkg/volume" </ins> ) const ( <del> maxLUN = 64 // max number of LUNs per VM </del> <ins> maxLUN               = 64 // max number of LUNs per VM errLeaseFailed       = "AcquireDiskLeaseFailed" errLeaseIDMissing    = "LeaseIdMissing" errContainerNotFound = "ContainerNotFound" </ins> ) // AttachDisk attaches a vhd to vm

if err != nil { glog.Errorf("azure attach failed, err: %v", err) detail := err.Error() <del> if strings.Contains(detail, "Code="AcquireDiskLeaseFailed"") { </del> <ins> if strings.Contains(detail, errLeaseFailed) { </ins> // if lease cannot be acquired, immediately detach the disk and return the original error glog.Infof("failed to acquire disk lease, try detach") az.DetachDiskByName(diskName, diskURI, nodeName)

err = az.deleteVhdBlob(accountName, key, blob) if err != nil { glog.Warningf("failed to delete blob %s err: %v", uri, err) <ins> detail := err.Error() if strings.Contains(detail, errLeaseIDMissing) { // disk is still being used // see https://msdn.microsoft.com/en-us/library/microsoft.windowsazure.storage.blob.protocol.bloberrorcodestrings.leaseidmissing.aspx return volume.NewDeletedVolumeInUseError(fmt.Sprintf("disk %q is still in use while being deleted", name)) } </ins> return fmt.Errorf("failed to delete vhd %v, account %s, blob %s, err: %v", uri, accountName, blob, err) } glog.V(4).Infof("blob %s deleted", uri)