<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def create(cls, ip_version, datacenter, bandwidth, vlan, vm, ip, background):
 """ Create a new iface """

        if not background and not cls.intty():
            background = True

        datacenter_id_ = int(Datacenter.usable_id(datacenter))

        iface_params = {
            'ip_version': ip_version,
            'datacenter_id': datacenter_id_,
            'bandwidth': bandwidth,
        }
        if vlan:
            iface_params['vlan'] = Vlan.usable_id(vlan)
            if ip:
                iface_params['ip'] = ip

        result = cls.call('hosting.iface.create', iface_params)

        if background and not vm:
            return result

        # interactive mode, run a progress bar
        cls.echo('Creating your iface.')
        cls.display_progress(result)
        iface_info = cls._info(result['iface_id'])
        cls.echo('Your iface has been created with the following IP '
                 'addresses:')
        for _ip in iface_info['ips']:
            cls.echo('ip%d:\t%s' % (_ip['version'], _ip['ip']))

        if not vm:
            return result

        vm_id = Iaas.usable_id(vm)
        result = cls._attach(result['iface_id'], vm_id)

        if background:
            return result

        cls.echo('Attaching your iface.')
        cls.display_progress(result)
        return result