diff --git a/cloud-control-manager/cloud-driver/drivers/cloudit/resources/VMSpecHandler.go b/cloud-control-manager/cloud-driver/drivers/cloudit/resources/VMSpecHandler.go index f26c78fc6..dcc949c5a 100644 --- a/cloud-control-manager/cloud-driver/drivers/cloudit/resources/VMSpecHandler.go +++ b/cloud-control-manager/cloud-driver/drivers/cloudit/resources/VMSpecHandler.go @@ -38,11 +38,10 @@ func setterVMSpec(region string, vmSpec specs.VMSpecInfo) *irs.VMSpecInfo { Region: region, Name: vmSpec.Name, VCpu: irs.VCpuInfo{Count: strconv.Itoa(vmSpec.Cpu)}, - Mem: strconv.Itoa(vmSpec.Mem), Gpu: []irs.GpuInfo{{Count: strconv.Itoa(vmSpec.GPU)}}, KeyValueList: nil, } - + vmSpecInfo.Mem = strconv.FormatFloat(float64(vmSpec.Mem)*1024, 'f', 0, 64) return vmSpecInfo } diff --git a/cloud-control-manager/cloud-driver/drivers/openstack/resources/VMHandler.go b/cloud-control-manager/cloud-driver/drivers/openstack/resources/VMHandler.go index 29e8e84a9..30d919ba5 100644 --- a/cloud-control-manager/cloud-driver/drivers/openstack/resources/VMHandler.go +++ b/cloud-control-manager/cloud-driver/drivers/openstack/resources/VMHandler.go @@ -146,16 +146,18 @@ func (vmHandler *OpenStackVMHandler) StartVM(vmReqInfo irs.VMReqInfo) (irs.VMInf vmId := server.ID var isDeployed bool var serverInfo irs.VMInfo - + var serverResult *servers.Server for { if isDeployed { + serverResult, err = servers.Get(vmHandler.Client, vmId).Extract() + serverInfo = vmHandler.mappingServerInfo(*serverResult) break } time.Sleep(5 * time.Second) // Check VM Deploy Status - serverResult, err := servers.Get(vmHandler.Client, vmId).Extract() + serverResult, err = servers.Get(vmHandler.Client, vmId).Extract() if err != nil { return irs.VMInfo{}, err } @@ -164,12 +166,10 @@ func (vmHandler *OpenStackVMHandler) StartVM(vmReqInfo irs.VMReqInfo) (irs.VMInf if ok, err := vmHandler.AssociatePublicIP(serverResult.ID); !ok { return irs.VMInfo{}, err } - - serverInfo = vmHandler.mappingServerInfo(*serverResult) isDeployed = true + } } - return serverInfo, nil } @@ -417,7 +417,6 @@ func (vmHandler *OpenStackVMHandler) mappingServerInfo(server servers.Server) ir KeyValueList: nil, SecurityGroupIIds: nil, } - if creatTime, err := time.Parse(time.RFC3339, server.Created); err == nil { vmInfo.StartTime = creatTime } @@ -457,7 +456,6 @@ func (vmHandler *OpenStackVMHandler) mappingServerInfo(server servers.Server) ir vmInfo.SecurityGroupIIds = securityGroupIdArr } - // VM Subnet, IP 정보 설정 for k, subnet := range server.Addresses { // VPC 정보 설정 vmInfo.VpcIID.NameId = k @@ -465,7 +463,6 @@ func (vmHandler *OpenStackVMHandler) mappingServerInfo(server servers.Server) ir if network != nil { vmInfo.VpcIID.SystemId = network.ID } - // PrivateIP, PublicIp 설정 for _, addr := range subnet.([]interface{}) { addrMap := addr.(map[string]interface{})