-
Notifications
You must be signed in to change notification settings - Fork 168
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
Clean the env before vm clone #6089
base: master
Are you sure you want to change the base?
Conversation
before the test, there could be error: after the fix, run the same with with existing VM 'avocado-vt-vm2'
|
@nanli1 Hi Please help to review, Thank you! |
all_vm_list = virsh.dom_list('--name --all').stdout.strip().splitlines() | ||
logging.debug("All vm on the host: %s", all_vm_list) | ||
for vm_i in all_vm_list: | ||
if vm_i.startswith("avocado-vt-vm") and vm_i != "avocado-vt-vm1": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we use guest_name = ("%s" % main_vm_name[:-1])+("%s" % str(i+2)) to as cloned name , right? if so, could we if vm_i.startswith(main_vm_name) and vm_i != "main_vm_name":
here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated and tested pass
0365ea1
to
b4891f4
Compare
There could be scenario that existing VMs with the same name which block the following operations. Remove these VMs to clean the env. Signed-off-by: Yalan Zhang <[email protected]>
b4891f4
to
e95578b
Compare
There could be scenario that existing VMs with the same name which block the following operations. Remove these VMs to clean the env.