improve datacenter name handling
This commit is contained in:
@@ -79,8 +79,13 @@ func (h *Handler) VmCreate(w http.ResponseWriter, r *http.Request) {
|
||||
//prettyPrint(vmObject)
|
||||
|
||||
// calculate VM properties we want to store
|
||||
numRam = vmObject.Vm.Config.Hardware.MemoryMB
|
||||
numVcpus = vmObject.Vm.Config.Hardware.NumCPU * vmObject.Vm.Config.Hardware.NumCoresPerSocket
|
||||
if vmObject.Vm.Config != nil {
|
||||
numRam = vmObject.Vm.Config.Hardware.MemoryMB
|
||||
numVcpus = vmObject.Vm.Config.Hardware.NumCPU * vmObject.Vm.Config.Hardware.NumCoresPerSocket
|
||||
} else {
|
||||
h.Logger.Error("Empty VM config")
|
||||
}
|
||||
|
||||
}
|
||||
err = vc.Logout()
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user