Skip to content

How to create a VM on the specific openstack compute node? #688

Open

Description

@kselvangit

hi,
I Would like to start the VM/Virtual Cluster on the particular openstack compute node.
Where I can give the host name as input to the elasticluster tool?

Thanks & Regards,
Kalai

Activity

  1. riccardomurri commented on Dec 24, 2020

    @riccardomurri
    Contributor

    As far as I remember, you cannot tell OpenStack to place a VM on a specific node: that's the job of the Nova scheduler. You can control what nodes are considered as candidates for hosting a VM using affinity and anti-affinity policies, see e.g.: https://blog.egonzalez.org/openstack/index/openstack-affinity-anti-affinity-groups It is up to the admins to define affinity and anti-affinity policies, however.

    I'm afraid ElastiCluster at the moment only supports anti-affinity policies (to avoid placing compute nodes on the same hypervisor, which helps especially in case of overcommitted CPUs). It would not be hard to add support for affinity policies if you need it: please feel free to file a feature request (but I will need help with testing, as I no longer have access to an OpenStack cluster).

  2. kselvangit commented on Dec 28, 2020

    @kselvangit
    Author

    Hi,
    Thanks for you reply. I came across the following .... manual..... on how to start the VM on the specific host.
    https://docs.openstack.org/nova/train/admin/availability-zones.html

    Will it be possible something like this with elasticluster tool?.
    I need it urgently, Your help will be highly appreciable .
    Thanks & Regards,
    Kalai

  3. riccardomurri commented on Dec 29, 2020

    @riccardomurri
    Contributor

    Hello @kselvangit

    thanks for pointing out the documentation; it should be possible to add the relevant code to ElastiCluster.

    However, consider that the key phrase in that page is With the appropriate permissions, you can select which host instances are launched on -- in other words, administrators must grant your account permissions to specify the host on which VM instances are to be created. But then, if administrators are OK granting you that privilege, they can already create an affinity group or availability zone with a single host in it and let you use that :-) without any modification of ElastiCluster.

    In other words: such placement functionality is already available to admins and people authorized by admins (just in a less direct way); if you're not an OpenStack admin, then it won't matter whether ElastiCluster implements it: you won't be able to use it.

  4. LaytonCC commented on Feb 6, 2021

    @LaytonCC

    I know I am late to the game but wanted to post this in case it can still help someone.
    @kselvangit , you can request a custom flavor that launches on select hardware via a Host Aggregate. This can be tuned to launch on a select system (or systems) if you set it up right. To echo what @riccardomurri said you would need a Openstack Admin to set this up or, if you are lucky, you can use a host in a Host Aggregate that is already configured if you can confirm it meets your needs.

    If you are lucky your admin has granted rights for you to check this out via the API. A example of this output (some project names removed) is below :

    #openstack aggregate list
    +----+------------------------+-------------------+
    | ID | Name | Availability Zone |
    +----+------------------------+-------------------+
    | 3 | lustre | Lustre-OpenStack |
    | 5 | highmem-r0 | nova |
    | 11 | birthright-m1 | nova |
    | 12 | birthright-m2 | nova |
    | 17 | highmem-r1 | nova |
    | 20 | gpu-g2-nvlink | nova |
    | 23 | highmemXL-r0 | nova |
    | 26 | volta-32g | nova |
    | 33 | k40-12g | nova |
    | 39 | AMD-HPC | nova |
    +----+------------------------+-------------------+
    Then you have to be extra lucky that the Host Aggregates describe what you are looking for.

    You can dig deeper via commands like :

    #openstack aggregate show gpu-g2-nvlink
    +-------------------+---------------------------------------+
    | Field | Value |
    +-------------------+---------------------------------------+
    | availability_zone | nova |
    | created_at | 2018-09-27T05:47:35.000000 |
    | deleted | False |
    | deleted_at | None |
    | hosts | [u'or-osp9-hyp55.localdomain'] |
    | id | 20 |
    | name | gpu-g2-nvlink |
    | properties | cpu='skylake', gpu='volta-32g-nvlink' |
    | updated_at | 2018-09-27T05:48:10.000000 |
    +-------------------+---------------------------------------+

    In this example the flavor :

    g2.3xlarge.4volta16g_nv

    as seen here:

    #openstack flavor show 403
    +----------------------------+-------------------------------------------------------------------------------------------+
    | Field | Value |
    +----------------------------+-------------------------------------------------------------------------------------------+
    | OS-FLV-DISABLED:disabled | False |
    | OS-FLV-EXT-DATA:ephemeral | 0 |
    | disk | 80 |
    | id | 403 |
    | name | g2.3xlarge.4volta16g_nv |
    | os-flavor-access:is_public | False |
    | properties | aggregate_instance_extra_specs:gpu='volta-32g-nvlink', pci_passthrough:alias='volta16g:4' |
    | ram | 368640 |
    | rxtx_factor | 1.0 |
    | swap | |
    | vcpus | 80 |
    +----------------------------+-------------------------------------------------------------------------------------------+

    launches on this node and consumes all of it. This is done via the extra_specs part of the flavor above.

    Hope this helps. I am a Openstack Admin so I can do this but I do often handle requests for my users to do exactly what you asked.

  5. kselvangit commented on Feb 8, 2021

    @kselvangit
    Author

    Thanks @LaytonCC ...

    Can we create availability-zone with the selected nodes through openstack commandline and supply as input in the elasticluster config file availability-zone parameter?. If this is possible, my work is done.....

    Hopefully waiting for your reply.

    Thanks & Regards,
    Kalaiselvan

  6. LaytonCC commented on Feb 8, 2021

    @LaytonCC

    @kselvangit Let me open with I am a new user to Elasticluster , so I may not know every config option.

    So with that said I think what you might be looking for is a Host Aggregate but if you really want to use a hostname what you might be looking for is a Floating IP or a static Neutron Port as well.

    A basic breakdown :

    Location of launched Instance

    • availability-zone : This is , in my experience, how people separate the Openstack environment at a high level (IE different datacenters). I do not see much use for this in Elasticluster but I am sure there are use cases (for my use case the multi-datacenter latency spikes would be a showstopper for my HPC use case).
    • Host Aggregate : This determines the hardware you launch on and is hooked to the hardware via the "flavor=" section of your compute environment.
    • Flavor : This is the metadata about what you are launching (Cores/RAM/Storage/IP/Etc) and has metadata like the "aggregate_instance_extra_specs" seen above that tells it which Host Aggregate to land on.

    A working example for your single host request, if you have admin rights, is to have a "Host Aggregate" with only one host and then launch a flavor tied to that host and use a Floating IP that hooks in with DNS via designate or other tooling to give you the DNS/Hostname I think you are looking for.

    As show above if I wanted to always land on our 4 NVLink GPU system (we only have one) I would set :

    flavor=g2.3xlarge.4volta16g_nv

    in my config. This means when you launch that section of your config it will launch 1 compute node with that flavor which would give you that node.

    Having a compute cluster it might also make sense to always want to use Skylake, Mi60 GPU, or other custom config in your setup. This can also be done via flavor settings.

    One thing I have learned from running Openstack for several years is there are MANY ways to solve each issue. And each sites setup is different so understanding what your on and what it offers might help lead you to a solution for your issue (that being nice to your Openstack admins).

    Hope that helps.

    -Chris

  7. kselvangit commented on Feb 8, 2021

    @kselvangit
    Author

    Thanks @LaytonCC
    So host name also can be a flavour in host aggregate? If it is so, that is what I wanted .... let me try this.

    Regards,
    Kalai

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions