Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
2bfdad1e
Commit
2bfdad1e
authored
Jun 23, 2014
by
James Cammarata
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7904 from loglevel9/7903
force evaluation of vars memory_mb, num_cpus to be int fixes #7903
parents
59c5d629
677e99e3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
library/cloud/vsphere_guest
+6
-6
No files found.
library/cloud/vsphere_guest
View file @
2bfdad1e
...
...
@@ -496,7 +496,7 @@ def reconfigure_vm(vsphere_client, vm, module, esxi, resource_pool, cluster_name
# Change Memory
if
vm_hardware
[
'memory_mb'
]:
if
vm_hardware
[
'memory_mb'
]
!=
vm
.
properties
.
config
.
hardware
.
memoryMB
:
if
int
(
vm_hardware
[
'memory_mb'
])
!=
vm
.
properties
.
config
.
hardware
.
memoryMB
:
spec
=
spec_singleton
(
spec
,
request
,
vm
)
if
vm
.
is_powered_on
():
...
...
@@ -504,7 +504,7 @@ def reconfigure_vm(vsphere_client, vm, module, esxi, resource_pool, cluster_name
# No hot add but force
if
not
memoryHotAddEnabled
:
shutdown
=
True
elif
vm_hardware
[
'memory_mb'
]
<
vm
.
properties
.
config
.
hardware
.
memoryMB
:
elif
int
(
vm_hardware
[
'memory_mb'
])
<
vm
.
properties
.
config
.
hardware
.
memoryMB
:
shutdown
=
True
else
:
# Fail on no hot add and no force
...
...
@@ -514,7 +514,7 @@ def reconfigure_vm(vsphere_client, vm, module, esxi, resource_pool, cluster_name
"required for shutdown"
)
# Fail on no force and memory shrink
elif
vm_hardware
[
'memory_mb'
]
<
vm
.
properties
.
config
.
hardware
.
memoryMB
:
elif
int
(
vm_hardware
[
'memory_mb'
])
<
vm
.
properties
.
config
.
hardware
.
memoryMB
:
module
.
fail_json
(
msg
=
"Cannot lower memory on a live VM. force is "
"required for shutdown"
)
...
...
@@ -525,7 +525,7 @@ def reconfigure_vm(vsphere_client, vm, module, esxi, resource_pool, cluster_name
# ====( Config Memory )====#
if
vm_hardware
[
'num_cpus'
]:
if
vm_hardware
[
'num_cpus'
]
!=
vm
.
properties
.
config
.
hardware
.
numCPU
:
if
int
(
vm_hardware
[
'num_cpus'
])
!=
vm
.
properties
.
config
.
hardware
.
numCPU
:
spec
=
spec_singleton
(
spec
,
request
,
vm
)
if
vm
.
is_powered_on
():
...
...
@@ -533,7 +533,7 @@ def reconfigure_vm(vsphere_client, vm, module, esxi, resource_pool, cluster_name
# No hot add but force
if
not
cpuHotAddEnabled
:
shutdown
=
True
elif
vm_hardware
[
'num_cpus'
]
<
vm
.
properties
.
config
.
hardware
.
numCPU
:
elif
int
(
vm_hardware
[
'num_cpus'
])
<
vm
.
properties
.
config
.
hardware
.
numCPU
:
if
not
cpuHotRemoveEnabled
:
shutdown
=
True
else
:
...
...
@@ -544,7 +544,7 @@ def reconfigure_vm(vsphere_client, vm, module, esxi, resource_pool, cluster_name
"required for shutdown"
)
# Fail on no force and cpu shrink without hot remove
elif
vm_hardware
[
'num_cpus'
]
<
vm
.
properties
.
config
.
hardware
.
numCPU
:
elif
int
(
vm_hardware
[
'num_cpus'
])
<
vm
.
properties
.
config
.
hardware
.
numCPU
:
if
not
cpuHotRemoveEnabled
:
module
.
fail_json
(
msg
=
"Cannot lower CPU on a live VM without "
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment