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

Fixed `enable_vnc` runner arg being passed into `seed_cmd` module arg in `virt.init`. #48731

Merged
merged 2 commits into from Jul 26, 2018

Conversation

Projects
None yet
6 participants
@zer0def
Contributor

zer0def commented Jul 24, 2018

What does this PR do?

Currently the salt-run virt.init call passes it's enable_vnc argument into salt-call --local virt.init's seed_cmd positional argument, causing seeding to fail. This is a bugfix to that behavior and hopefully future-proofs for situations of positional argument shifts in function definitions.

Tests written?

No

@Arabus

This comment has been minimized.

Contributor

Arabus commented Jul 24, 2018

This should fix #40212 and #43928

@zer0def

This comment has been minimized.

Contributor

zer0def commented Jul 24, 2018

Improves on #45123

@rallytime rallytime requested a review from gtmanfred Jul 26, 2018

@rallytime rallytime merged commit 41464d4 into saltstack:2017.7 Jul 26, 2018

8 checks passed

WIP ready for review
Details
continuous-integration/jenkins/pr-merge This commit looks good
Details
jenkins/pr/docs The docs job has passed
Details
jenkins/pr/lint The lint job has passed
Details
jenkins/pr/py2-centos-7 The py2-centos-7 job has passed
Details
jenkins/pr/py2-ubuntu-1604 The py2-ubuntu-1604 job has passed
Details
jenkins/pr/py3-centos-7 The py3-centos-7 job has passed
Details
jenkins/pr/py3-ubuntu-1604 The py3-ubuntu-1604 job has passed
Details
@kaaelhaa

This comment has been minimized.

Contributor

kaaelhaa commented Jul 26, 2018

Awesome! Thanks for doing this as I could not find the time needed for looking further into it. 👍

@dxiri

This comment has been minimized.

dxiri commented Aug 31, 2018

@Arabus @zer0def

Regarding #40212 just tested this out for the enable_vnc=True part. It still isn't working, VM gets deployed ok but ends up with no graphics attached at all. I placed virt.py file inside my _runners_ folder and then did "salt-run saltutil.sync_runners". Here is the output:

  1. sudo salt-run -l debug virt.init rd_centos7_00 2 2048 salt://centos7-base.img seed=False enable_vnc=True

[DEBUG ] Reading configuration from /etc/salt/master
11:25:02 [DEBUG ] Including configuration from '/etc/salt/master.d/master-config.conf'
11:25:02 [DEBUG ] Reading configuration from /etc/salt/master.d/master-config.conf
11:25:02 [DEBUG ] Including configuration from '/etc/salt/master.d/virt-profiles.conf'
11:25:02 [DEBUG ] Reading configuration from /etc/salt/master.d/virt-profiles.conf
11:25:02 [DEBUG ] Using cached minion ID from /etc/salt/minion_id: a172-25-169-134.deploy
11:25:02 [DEBUG ] Missing configuration file: /root/.saltrc
11:25:02 [DEBUG ] Configuration file path: /etc/salt/master
11:25:02 [WARNING ] Insecure logging configuration detected! Sensitive data may be logged.
11:25:02 [DEBUG ] LazyLoaded virt.init
11:25:02 [DEBUG ] Reading configuration from /etc/salt/master
11:25:02 [DEBUG ] Including configuration from '/etc/salt/minion.d/00-minion-config.conf'
11:25:02 [DEBUG ] Reading configuration from /etc/salt/minion.d/00-minion-config.conf
11:25:02 [DEBUG ] Including configuration from '/etc/salt/minion.d/99-master-address.conf'
11:25:02 [DEBUG ] Reading configuration from /etc/salt/minion.d/99-master-address.conf
11:25:02 [DEBUG ] Including configuration from '/etc/salt/minion.d/_schedule.conf'
11:25:02 [DEBUG ] Reading configuration from /etc/salt/minion.d/_schedule.conf
11:25:02 [DEBUG ] Using cached minion ID from /etc/salt/minion_id: a172-25-169-134.deploy
11:25:02 [DEBUG ] Grains refresh requested. Refreshing grains.
11:25:02 [DEBUG ] Reading configuration from /etc/salt/master
11:25:02 [DEBUG ] Including configuration from '/etc/salt/master.d/master-config.conf'
11:25:02 [DEBUG ] Reading configuration from /etc/salt/master.d/master-config.conf
11:25:02 [DEBUG ] Including configuration from '/etc/salt/master.d/virt-profiles.conf'
11:25:02 [DEBUG ] Reading configuration from /etc/salt/master.d/virt-profiles.conf
11:25:02 [DEBUG ] MasterEvent PUB socket URI: /var/run/salt/master/master_event_pub.ipc
11:25:02 [DEBUG ] MasterEvent PULL socket URI: /var/run/salt/master/master_event_pull.ipc
11:25:02 [DEBUG ] Initializing new IPCClient for path: /var/run/salt/master/master_event_pull.ipc
11:25:02 [DEBUG ] Sending event: tag = salt/run/20180831172502106606/new; data = {u'fun': u'runner.virt.init', u'fun_args': [u'rd_centos7_00', 2, 2048, u'salt://centos7-base.img', {u'seed': False, u'enable_vnc': True}], u'jid': u'20180831172502106606', u'user': u'sudo_rundeck', u'_stamp': '2018-08-31T17:25:02.654356'}
11:25:02 [DEBUG ] Sending event: tag = salt/run/20180831172502106606/progress; data = {u'message': u'Searching for hosts', u'_stamp': '2018-08-31T17:25:02.654773'}
11:25:02 [DEBUG ] LazyLoaded nested.output
11:25:02 [WARNING ] 'quiet' is deprecated. Please migrate to --quiet
11:25:02 [DEBUG ] Reading configuration from /etc/salt/master
11:25:02 [DEBUG ] Including configuration from '/etc/salt/master.d/master-config.conf'
11:25:02 [DEBUG ] Reading configuration from /etc/salt/master.d/master-config.conf
11:25:02 [DEBUG ] Including configuration from '/etc/salt/master.d/virt-profiles.conf'
11:25:02 [DEBUG ] Reading configuration from /etc/salt/master.d/virt-profiles.conf
11:25:02 [DEBUG ] Using cached minion ID from /etc/salt/minion_id: a172-25-169-134.deploy
11:25:02 [DEBUG ] Missing configuration file: /root/.saltrc
11:25:02 [DEBUG ] MasterEvent PUB socket URI: /var/run/salt/master/master_event_pub.ipc
11:25:02 [DEBUG ] MasterEvent PULL socket URI: /var/run/salt/master/master_event_pull.ipc
11:25:02 [DEBUG ] Initializing new AsyncZeroMQReqChannel for (u'/etc/salt/pki/master', u'a172-25-169-134.deploy_master', u'tcp://127.0.0.1:4506', u'clear')
11:25:02 [DEBUG ] Connecting the Minion to the Master URI (for the return server): tcp://127.0.0.1:4506
11:25:02 [DEBUG ] Trying to connect to: tcp://127.0.0.1:4506
11:25:02 [DEBUG ] Initializing new IPCClient for path: /var/run/salt/master/master_event_pub.ipc
11:25:02 [DEBUG ] LazyLoaded local_cache.get_load
11:25:02 [DEBUG ] Reading minion list from /var/cache/salt/master/jobs/8b/45c4563ad4d345f36f310448169f698bf6ec8f4624732ebe735824e88f6772/.minions.p
11:25:02 [DEBUG ] get_iter_returns for jid 20180831172502738731 sent to set(['a172-25-169-134.deploy', 'a172-25-169-137', 'a172-25-169-147.deploy', 'a172-25-169-133.deploy', 'a172-25-169-136']) will timeout at 17:25:07.748767
11:25:03 [DEBUG ] jid 20180831172502738731 return from a172-25-169-147.deploy
11:25:03 [DEBUG ] jid 20180831172502738731 return from a172-25-169-137
11:25:04 [DEBUG ] jid 20180831172502738731 return from a172-25-169-136
11:25:04 [DEBUG ] jid 20180831172502738731 return from a172-25-169-133.deploy
11:25:04 [DEBUG ] jid 20180831172502738731 return from a172-25-169-134.deploy
11:25:04 [DEBUG ] jid 20180831172502738731 found all minions set([u'a172-25-169-136', u'a172-25-169-137', u'a172-25-169-147.deploy', u'a172-25-169-133.deploy', u'a172-25-169-134.deploy'])
11:25:04 [DEBUG ] Reading configuration from /etc/salt/master
11:25:04 [DEBUG ] Including configuration from '/etc/salt/master.d/master-config.conf'
11:25:04 [DEBUG ] Reading configuration from /etc/salt/master.d/master-config.conf
11:25:04 [DEBUG ] Including configuration from '/etc/salt/master.d/virt-profiles.conf'
11:25:04 [DEBUG ] Reading configuration from /etc/salt/master.d/virt-profiles.conf
11:25:04 [DEBUG ] Using cached minion ID from /etc/salt/minion_id: a172-25-169-134.deploy
11:25:04 [DEBUG ] Missing configuration file: /root/.saltrc
11:25:04 [DEBUG ] MasterEvent PUB socket URI: /var/run/salt/master/master_event_pub.ipc
11:25:04 [DEBUG ] MasterEvent PULL socket URI: /var/run/salt/master/master_event_pull.ipc
11:25:04 [DEBUG ] Sending event: tag = salt/run/20180831172502106606/progress; data = {u'message': u'Creating VM rd_centos7_00 on host a172-25-169-147.deploy', u'_stamp': '2018-08-31T17:25:04.860072'}
11:25:04 [DEBUG ] LazyLoaded nested.output
11:25:04 [DEBUG ] Initializing new AsyncZeroMQReqChannel for (u'/etc/salt/pki/master', u'a172-25-169-134.deploy_master', u'tcp://127.0.0.1:4506', u'clear')
11:25:04 [DEBUG ] Connecting the Minion to the Master URI (for the return server): tcp://127.0.0.1:4506
11:25:04 [DEBUG ] Trying to connect to: tcp://127.0.0.1:4506
11:25:04 [DEBUG ] Initializing new IPCClient for path: /var/run/salt/master/master_event_pub.ipc
11:25:04 [DEBUG ] LazyLoaded local_cache.get_load
11:25:04 [DEBUG ] Reading minion list from /var/cache/salt/master/jobs/57/97b2c47cea9f82be28ccbec55ae94b98adb33690a39fc1347ffb666ba3580f/.minions.p
11:25:04 [DEBUG ] get_iter_returns for jid 20180831172504871743 sent to set(['a172-25-169-147.deploy']) will timeout at 17:35:04.886301
11:27:34 [DEBUG ] jid 20180831172504871743 return from a172-25-169-147.deploy
11:27:34 [DEBUG ] Sending event: tag = salt/run/20180831172502106606/progress; data = {u'message': u'VM rd_centos7_00 initialized on host a172-25-169-147.deploy', u'_stamp': '2018-08-31T17:27:34.785363'}
11:27:34 [DEBUG ] LazyLoaded nested.output
11:27:34 [DEBUG ] LazyLoaded local_cache.prep_jid
11:27:34 [DEBUG ] Adding minions for job 20180831172502106606: [u'a172-25-169-134.deploy_master']
11:27:34 [DEBUG ] Sending event: tag = salt/run/20180831172502106606/ret; data = {u'fun_args': [u'rd_centos7_00', 2, 2048, u'salt://centos7-base.img', {u'seed': False, u'enable_vnc': True}], u'jid': u'20180831172502106606', u'return': u'good', u'success': True, u'_stamp': '2018-08-31T17:27:34.800034', u'user': u'sudo_rundeck', u'fun': u'runner.virt.init'}
11:27:34 [DEBUG ] LazyLoaded nested.output
11:27:34 [INFO ] Runner completed: 20180831172502106606
11:27:34 [DEBUG ] Runner return: good
11:27:34 event:
11:27:34 ----------
11:27:34 _stamp:
11:27:34 2018-08-31T17:25:02.654773
11:27:34 message:
11:27:34 Searching for hosts
11:27:34 suffix:
11:27:34 progress
11:27:34 event:
11:27:34 ----------
11:27:34 _stamp:
11:27:34 2018-08-31T17:25:04.860072
11:27:34 message:
11:27:34 Creating VM rd_centos7_00 on host a172-25-169-147.deploy
11:27:34 suffix:
11:27:34 progress
11:27:34 event:
11:27:34 ----------
11:27:34 _stamp:
11:27:34 2018-08-31T17:27:34.785363
11:27:34 message:
11:27:34 VM rd_centos7_00 initialized on host a172-25-169-147.deploy
11:27:34 suffix:
11:27:34 progress
11:27:34 good

Resulting VM with no graphics:
image

@zer0def

This comment has been minimized.

Contributor

zer0def commented Aug 31, 2018

Unable to reproduce (meaning the video and display devices appear in the resulting domain's XML config), attached log doesn't provide any useful information. Please explicitly target a minion for VM deployment using the host kwarg and gather that minion's debug log.

Couple of other things to take note of:

  • I think you meant the _runners directory in master's file_roots, not _runners_
  • given how this is a master-side-specific functionality (in this case, runner) fix, it might require placing the patched module according to master's extension_modules and/or module_dirs settings
@dxiri

This comment has been minimized.

dxiri commented Sep 10, 2018

@zer0def turns out that was the problem! I had runners instead of _runners :)

after reading your comment above I noticed this, renamed the folder, ran

salt-run saltutil.sync_runners

and it worked!

Thank you! 💯

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