'Create a flavor.
:param name: Descriptive name of the flavor
:param ram: Memory in MB for the flavor
:param vcpus: Number of VCPUs for the flavor
:param disk: Size of local disk in GB
:param flavorid: ID for the flavor (optional). You can use the reserved
value ``"auto"`` to have Nova generate a UUID for the
flavor in cases where you cannot simply pass ``None``.
:param swap: Swap space in MB
:param rxtx_factor: RX/TX factor
:returns: :class:`Flavor`'

def create(self, name, ram, vcpus, disk, flavorid='auto', ephemeral=0, swap=0, rxtx_factor=1.0, is_public=True):

    try:
        ram = int(ram)
    except (TypeError, ValueError):
        raise exceptions.CommandError(_('Ram    must    be    an    integer.'))
    try:
        vcpus = int(vcpus)
    except (TypeError, ValueError):
        raise exceptions.CommandError(_('VCPUs    must    be    an    integer.'))
    try:
        disk = int(disk)
    except (TypeError, ValueError):
        raise exceptions.CommandError(_('Disk    must    be    an    integer.'))
    if (flavorid == 'auto'):
        flavorid = None
    try:
        swap = int(swap)
    except (TypeError, ValueError):
        raise exceptions.CommandError(_('Swap    must    be    an    integer.'))
    try:
        ephemeral = int(ephemeral)
    except (TypeError, ValueError):
        raise exceptions.CommandError(_('Ephemeral    must    be    an    integer.'))
    try:
        rxtx_factor = float(rxtx_factor)
    except (TypeError, ValueError):
        raise exceptions.CommandError(_('rxtx_factor    must    be    a    float.'))
    try:
        is_public = strutils.bool_from_string(is_public, True)
    except Exception:
        raise exceptions.CommandError(_('is_public    must    be    a    boolean.'))
    body = self._build_body(name, ram, vcpus, disk, flavorid, swap, ephemeral, rxtx_factor, is_public)
    return self._create('/flavors', body, 'flavor')
