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

Define Flavor for ECS #21

Open
spech66 opened this issue Feb 21, 2019 · 1 comment
Open

Define Flavor for ECS #21

spech66 opened this issue Feb 21, 2019 · 1 comment

Comments

@spech66
Copy link

spech66 commented Feb 21, 2019

First thank you again for providing this modules in the galaxy. Saved us a lot of time and trouble during our migration!
Currently there is a lot happening with the flavors in kind of generations (xen/kvm) and groups (General-purpose, Dedicated general-purpose, Memory-optimized, Large-memory, High-performance Disk-intensive, GPU-accelerated). I noticed that the select flavor code only searches for CPU/RAM.

- name: Set fact flavor_id if ecs_ram or ecs_vcpus is defined
  set_fact:
    flavor_id: "{{ (flavor_result.content|from_json)|json_query('sort_by(flavors, &ram)|[?ram>=`' + ecs_ram + '` && vcpus>=`\"' + ecs_vcpus + '\"`].id|[0]') }}"

What would be the best way to extend this query? Or would it be possible to drop ecs_ram/ecs_vcpus for something like ecs_flavor. Currently I specify 2 vcpus and 4096 MB RAM but I get
Dedicated general-purpose c3.large.2 instead of s2.large.2. Beside from that with the current implementation I wouldn't be able to target other specs/generations.
Thank you

@eumel8
Copy link
Owner

eumel8 commented May 29, 2019

@spech66 first of all, there is always the possibility to overwrite flavor_id with pickup the id from the list:

ansible-playbook test.yml -e "ecs_name=ansible-test02 localaction=flavors" -e "output=long"

For resource_type there is not real a logic for people without knowledge which resources are available.

msg: "{{ flavorlist.json|json_query('flavors[].os_extra_specs.resource_type') | sort | unique }}"

        "diskintensive", 
        "DiskIntensiveD2", 
        "gpu_m60", 
        "gpu_p100", 
        "gpu_v100", 
        "HighPerformanceH1", 
        "HighPerformanceH2", 
        "HighPerformanceHL", 
        "IOoptimizedC3", 
        "IOoptimizedS2", 
        "MemoryOptimizedM2", 
        "MemoryOptimizedM3", 
        "normal", 
        "saphana", 
        "vgpu_m60_1q"

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

No branches or pull requests

2 participants