[DOCS] salt-cloud and register_image function
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 15.7k
- Forks
- 5.6k
- Avg merge
- 2d 44m
- Merged PRs (30d)
- 80
Description
Description
Hello. I am relatively new to saltstack and salt-cloud.
I am trying to use salt-cloud function register_image
https://docs.saltproject.io/en/latest/ref/clouds/all/salt.cloud.clouds.ec2.html#salt.cloud.clouds.ec2.register_image
Current documentation has one CLI example but you can't see what parameters can be passed to this function.
While CLI example works fine, it creates AMI with one block device. So I was trying to create AMI with 2 block devices, and that option is not documented. But it exists. I've looked into source code (ec2.py) and there's argument block_device_mapping.
Now, I do not know what to pass as block_device_mapping.
I've played around a bit and added this line:
block_device_mapping = {'DeviceName': '/dev/xvda','Ebs': {'SnapshotId': 'snap-111111111','VolumeType': 'gp2'}}, {'DeviceName': '/dev/sdb','Ebs': {'SnapshotId': 'snap-222222222','VolumeType': 'gp2'}}
just before
params.update(_param_from_config('BlockDeviceMapping', block_device_mapping))
And with this I was able to create AMI with 2 block devices.
Now, the issue here is that I can't pass this in CLI:
salt-cloud -f register_image my-ec2-config ami_name=new_AMI description="new ami" architecture=x86_64 root_device_name=/dev/xvda block_device_mapping={'DeviceName': '/dev/xvda','Ebs': {'SnapshotId': 'snap-111111111','VolumeType': 'gp2'}}, {'DeviceName': '/dev/sdb','Ebs': {'SnapshotId': 'snap-222222222','VolumeType': 'gp2'}}
I've tried with double/single quotes but thad didn't work as python didn't interpret this correctly.
Does anybody know why to pass block_device_mapping to salt-cloud -f register_image ?
Suggested Fix
List of parameters that can be passed to function with examples how to use them.
Type of documentation
- Salt documentation
- Salt modules
- Man pages (which get autogenerated from the docs, such as salt.1 and salt.7)
Location or format of documentation
https://docs.saltproject.io/en/latest/ref/clouds/all/salt.cloud.clouds.ec2.html#salt.cloud.clouds.ec2.register_image
Additional context
Add any other context or screenshots about the feature request here.
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 with the salt.cloud.clouds.ec2.register_image documentation page and the referenced ec2.py implementation to identify the supported parameters and the expected block_device_mapping structure. Document the parameters with usable CLI examples, including multiple block devices, and verify that the examples reflect the function's accepted input.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, python
- Domain
- cloud, documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100