Bug Reference

CLOUDSTACK-718

Introduction

Purpose

With the current code for deploying a VM, CloudStack enables a VM to run on certain hosts using Host tags. If offerings are tagged, then only the host with matching tag will be chosen. But while deploying a VM with a non-tagged service offering, we consider both untagged and tagged hosts. So a VM with non-tagged offering may reside on a tagged host.  But there can be a situation where a user wants to ensure that his workload is not shared with other users i.e. his VMs should run on a host which is not shared with other accounts. 

This feature will allow to add a service offering that will indicate that the VM needs to be on a host exclusive to his account. The VMs belonging to his account will share the same host which is not shared by other accounts.

This document describes the specifications and design of this feature which is part of the requirements here.

References

Featured PRD: https://cwiki.apache.org/confluence/display/CLOUDSTACK/VMs+on+hardware+dedicated+to+a+specific+account

This feature is combined with requirements here

Feature Specifications

Requirements

  • VM service offerings can be created by the CloudStack administrator, which includes a field indicating that instances of the offering should be isolated onto a particular host (per CloudStack account).
  • VM offerings that don’t indicate the need for dedicated host will run on shared host with other tenants. 

The following table explains the requirements:

 

                                               Service Offering requested with dedication ON

Service Offering requested with dedication OFF

Account has NO implicitly dedicated host 

find a new free host and place VM and make the host part of the dedicated host for this account to be used for future requests  

Place VM in a non-dedicated area

Account has implicitly dedicated host

Place the vm in implicitly dedicated host. If space is not there find a new free host, make that host part of the dedicated host for this account .  
If no such host found, fail the request  

Place VM in a non-dedicated area

Note:

Implicitly dedicated Host is the host which is dedicated to an account and have dedicated VMs of same account.

Dedicated VM is created using Service Offering with "isDedicated" enabled.     

If Service Offering Flag is OFF, non-dedicated (shared) resources will be used.

User Permission

  • Only Root admin can add a service offering "isDedicated" option enabled.

Test Guidelines

  • Dedicated resources can only be used if service offering dedication flag is ON.

Use cases

VM Deployment
  1. Admin can add service offering with "isDedicated" option checked whereas domain-admin/users cannot.
  2. Host Setup : Host1 and Host2 , Host 1 has system vms , Host 2 is empty. Service Offering: SWD (Service offering with Dedication enabled), SND (Service offering without Dedication enabled)
  3. Root admin deploys a non-dedicated VM (SND), suppose it went to Host 2.
  4. Account a1 deploys a dedicated VM (SWD). Vm should be deployed in Host 1. Note: Host having only systemVms should be considered as empty host
  5. Any non-dedicated VM (SND) should go to Host 2
  6. Any dedicated VM (SWD) of different Account a2 or u2 will fail, Since no free host available.
  7. Any dedicated VM (SWD) of same Account a1 will use Host 1 only.
  8. If dedicated VMs in Host1 are deleted, the host should become available for all aacounts i.e  Anybody can use it.
Host Tags with isDedicated flag
  1. If Host Tag is provided and isDedicated flag is true
    1. if Host has dedicated vms, place the vm in the that host
    2. if Host has no dedicated vms, fail the request.
  2. If host tag is provided and isDedicated flag is false
    1. if Host has dedicated vms,  fail the request
    2. if Host has no dedicated vmsplace the vm in that host as cloudstack is doing now
Migration of dedicated VMs
  1. If VM to be migrated is non-dedicated
    1. if destination host has dedicated vms, fail the request
    2. if destination host has no dedicated vms, migrate it to the destination host.
  2. If VM to be migrated is dedicated
    1. if destination host has dedicated vms, migrate it to that host.
    2. if destination host has no dedicated vms, fail the request

Architecture and Design Description

API Change

Existing API modification:

  • createServiceOffering:  Request Parameter Addition:

Parameter Name

Description

Required

isdedicated

 if trueInstance will be deployed on the host dedicated to the account 

false

DB Change

service_offering table: Introduce a column “isdedicated” in  service_offering table. Default value should be 0.

UI flow

Add a check option: isDedicated in  "Add compute offering" window

  • No labels