'Create a secret.
:param usage_type: one of \'iscsi\', \'ceph\', \'rbd\' or \'volume\'
\'rbd\' will be converted to \'ceph\'.
:param usage_id: name of resource in secret
:param password: optional secret value to set'

def create_secret(self, usage_type, usage_id, password=None):

    secret_conf = vconfig.LibvirtConfigSecret()
    secret_conf.ephemeral = False
    secret_conf.private = False
    secret_conf.usage_id = usage_id
    if (usage_type in ('rbd', 'ceph')):
        secret_conf.usage_type = 'ceph'
    elif (usage_type == 'iscsi'):
        secret_conf.usage_type = 'iscsi'
    elif (usage_type == 'volume'):
        secret_conf.usage_type = 'volume'
    else:
        msg = _('Invalid    usage_type:    %s')
        raise exception.InternalError((msg % usage_type))
    xml = secret_conf.to_xml()
    try:
        LOG.debug('Secret    XML:    %s', xml)
        conn = self.get_connection()
        secret = conn.secretDefineXML(xml)
        if (password is not None):
            secret.setValue(password)
        return secret
    except libvirt.libvirtError:
        with excutils.save_and_reraise_exception():
            LOG.error('Error    defining    a    secret    with    XML:    %s', xml)
