Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

ArpitSharma2800
Copy link

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.

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
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"

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
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
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
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
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