Skip to content

added CPU config and clne vm along with CPU reconfig#694

Open
ArpitSharma2800 wants to merge 4 commits into
vmware:masterfrom
ArpitSharma2800:master
Open

added CPU config and clne vm along with CPU reconfig#694
ArpitSharma2800 wants to merge 4 commits into
vmware:masterfrom
ArpitSharma2800:master

Conversation

@ArpitSharma2800

Copy link
Copy Markdown

reconfigure_CPU_vm: command line interface to upgrade number of CPU.
clone_vm_CPU_reconfig: command line interface to clone VM template and reconfigure it.

Comment thread samples/clone_vm_CPU_reconfig.py Outdated
help='Version/release CPUs of the Virtual machine CPUs')

parser.add_custom_argument('--memory', required=False, action='store', default=None,
help='Version/release memory of the Virtual machine memories')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mention the unit of memory (MB ) in the help of "--memory"

Comment thread samples/clone_vm_CPU_reconfig.py Outdated
parser.add_custom_argument('--cpu', required=False, action='store', default=None,
help='Version/release CPUs of the Virtual machine CPUs')

parser.add_custom_argument('--memory', required=False, action='store', default=None,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

provide default value for both cpu and memory so, you can remove line 23-27

# Powering off VM for CPU change
if format(vm.runtime.powerState) == "poweredOn":
print("Attempting to power off {0}".format(vm.name))
TASK = vm.PowerOffVM_Task()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No caps for the "TASK". Make it "task"

from pyVmomi import vim
from tools import cli, service_instance, pchelper, tasks
from pyVim.task import WaitForTasks

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Run both the samples in python 2 and 3

@ArpitSharma2800

Copy link
Copy Markdown
Author

Python 2 support is deprecated
Note: python2 is deprecated from 01/2020 https://www.python.org/doc/sunset-python-2/. Please switch to Python3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants