[BUG] virtual grains fails to detect some Parallels VM's
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 15.7k
- Forks
- 5.6k
- Avg merge
- 2d 44m
- Merged PRs (30d)
- 80
Description
Description
The core grain virtual fails to properly detect some VM's running under Parallels and instead reports them as physical.
This is caused by the dmidecode command on Linux returning a manufacture slightly differently than salt expects.
Setup
I'm not entirely sure which are the important bits that cause dmidecode to return the new manufacture, but I'm able to reproduce the problem with Parallels version 18.1.0 on MacOS 13.0 under Apple Silicon, using a VM running Ubuntu 22.04. Salt 3005 was installed using the Debian 11 classic packages, since Ubuntu 22.04 packages are not available for arm64.
Steps to Reproduce the behavior
brew install vagrant # or your preferred method
vagrant init gvengel/salt-jammy-arm64
vagrant up
vagrant ssh -- salt-call --local grains.get virtual
Behavior
~/dev/salt % vagrant ssh -- sudo salt-call --local grains.get virtual
/usr/local/lib/python3.10/dist-packages/_distutils_hack/__init__.py:33: UserWarning: Setuptools is replacing distutils.
warnings.warn("Setuptools is replacing distutils.")
local:
physical
~/dev/salt %
Expected behavior
Should return "Parallels"
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the core virtual grain's Linux handling of dmidecode output and compare the reported manufacturer with the value expected for Parallels. Reproduce the issue in the stated Parallels, Apple Silicon, and Ubuntu 22.04 setup using the provided Vagrant commands. Done means salt-call --local grains.get virtual reports Parallels instead of physical.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- linux, python
- Domain
- devops, infrastructure, operating-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100