Change:
Is this a BUG REPORT or FEATURE REQUEST?: What happened: For unmanaged disk, now it is not working What you expected to happen: Works well How to reproduce it (as minimally and precisely as possible): Anything else we need to know?: Environment: Kubernetes version (use ): Client Version: version.Info{Major:"1", Minor:"9+", GitVersion:"v1.9.0-alpha.2.734+", GitCommit:"", GitTreeState:"clean", BuildDate:"2017-11-14T03:26:54Z", GoVersion:"go1.9.2", Compiler:"gc", Platform:"linux/amd64"} Server Version: version.Info{Major:"1", Minor:"9+", GitVersion:"v1.9.0-alpha.2.734+", GitCommit:"", GitTreeState:"clean", BuildDate:"2017-11-14T03:26:54Z", GoVersion:"go1.9.2", Compiler:"gc", Platform:"linux/amd64"} Cloud provider or hardware configuration: OS (e.g. from /etc/os-release): RHEL7 Kernel (e.g. ): Install tools: ansible Others:
/assign andyzhangx /sig azure
I cannot reproduce your issue with v1.9.0, in your storage class, an azure disk would be provisioned in storage account , it may fail because name is already occupied, but in your case it's a strage string: . So could you also paste the controller manager log, below is the way how to get it: There should be an important log like following:
I did not run containerized k8s, I deployed a cluster by ansible: I got the controller message as below: I am quit sure there is already a storage account in its resource group which is assigned in sc's parameter: I do not know why controller does not find it and wants to create a new one. But in our subscription the storage account has reached the max number and cannot be created anymore, the error is different from this.
cc
would you add in your stroage class, and try again? In your case, is not invoked due to: I am working out a PR to fix this, as a workaround, you could try storage class like following: Let me know if that works, thx
Yes. working now with this parameter :

Discussion:
"bytes" "encoding/binary" "fmt" <del> "math" </del> "net/url" <del> "os" </del> "regexp" "sync"

var defaultContainerName = "" var storageAccountNamePrefix = "" var storageAccountNameMatch = "" <del> var initFlag int64 </del> var accountsLock = &sync.Mutex{} func newBlobDiskController(common *controllerCommon) (*BlobDiskController, error) { c := BlobDiskController{common: common} <del> err := c.init() </del> <ins> c.setUniqueStrings() // get accounts accounts, err := c.getAllStorageAccounts() </ins> if err != nil { <del> return nil, err </del> <ins> glog.Errorf("azureDisk - getAllStorageAccounts error: %v", err) c.accounts = make(map[string]*storageAccountState) return &c, nil </ins> } <ins> c.accounts = accounts </ins> return &c, nil }

return err } <del> // Init tries best effort to ensure that 2 accounts standard/premium were created // to be used by shared blob disks. This to increase the speed pvc provisioning (in most of cases) func (c *BlobDiskController) init() error { if !c.shouldInit() { return nil } c.setUniqueStrings() // get accounts accounts, err := c.getAllStorageAccounts() if err != nil { return err } c.accounts = accounts if len(c.accounts) == 0 { counter := 1 for counter <= storageAccountsCountInit { accountType := storage.PremiumLRS if n := math.Mod(float64(counter), 2); n == 0 { accountType = storage.StandardLRS } // We don't really care if these calls failed // at this stage, we are trying to ensure 2 accounts (Standard/Premium) // are there ready for PVC creation // if we failed here, the accounts will be created in the process // of creating PVC // nor do we care if they were partially created, as the entire // account creation process is idempotent go func(thisNext int) { newAccountName := getAccountNameForNum(thisNext) glog.Infof("azureDisk - BlobDiskController init process  will create new storageAccount:%s type:%s", newAccountName, accountType) err := c.createStorageAccount(newAccountName, accountType, c.common.location, true) // TODO return created and error from if err != nil { glog.Infof("azureDisk - BlobDiskController init: create account %s with error:%s", newAccountName, err.Error()) } else { glog.Infof("azureDisk - BlobDiskController init: created account %s", newAccountName) } }(counter) counter = counter + 1 } } return nil } </del> //Sets unique strings to be used as accountnames && || blob containers names func (c *BlobDiskController) setUniqueStrings() { uniqueString := c.common.resourceGroup + c.common.location + c.common.subscriptionID

return int(c.accounts[SAName].diskCount), nil } <del> // shouldInit ensures that we only init the plugin once // and we only do that in the controller func (c *BlobDiskController) shouldInit() bool { if os.Args[0] == "kube-controller-manager" || (os.Args[0] == "/hyperkube" && os.Args[1] == "controller-manager") { swapped := atomic.CompareAndSwapInt64(&initFlag, 0, 1) if swapped { return true } } return false } </del> func (c *BlobDiskController) getAllStorageAccounts() (map[string]*storageAccountState, error) { accountListResult, err := c.common.cloud.StorageAccountClient.List() if err != nil {