From a8383bd11c7fe9fd0a0fe94abc917b1785feb73a Mon Sep 17 00:00:00 2001 From: ioito Date: Thu, 18 Jul 2019 15:02:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E9=AB=98openstack=E5=88=9B=E5=BB=BAwi?= =?UTF-8?q?ndows=E6=9C=BA=E5=99=A8=E6=88=90=E5=8A=9F=E7=8E=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/util/openstack/disk.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/util/openstack/disk.go b/pkg/util/openstack/disk.go index bcf918e51a..db08eb3020 100644 --- a/pkg/util/openstack/disk.go +++ b/pkg/util/openstack/disk.go @@ -293,7 +293,12 @@ func (region *SRegion) CreateDisk(imageRef string, category string, name string, } //这里由于不好初始化disk的storage就手动循环了,如果是通过镜像创建,有个下载过程,比较慢,等待时间较长 startTime := time.Now() - for time.Now().Sub(startTime) < time.Minute*10 { + timeout := time.Minute * 10 + //若是通过镜像创建,需要先下载镜像,需要的时间更长 + if len(imageRef) > 0 { + timeout = time.Minute * 30 + } + for time.Now().Sub(startTime) < timeout { disk, err = region.GetDisk(disk.GetGlobalId()) if err != nil { return nil, err