<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def erase_disk_partitions(service_instance, host_ref, disk_id,
                          hostname=None, storage_system=None):
    '''
    Erases all partitions on a disk

    in a vcenter filtered by their names and/or datacenter, cluster membership

    service_instance
        The Service Instance Object from which to obtain all information

    host_ref
        The reference of the ESXi host containing the disk

    disk_id
        The canonical name of the disk whose partitions are to be removed

    hostname
        The ESXi hostname. Default is None.

    storage_system
        The ESXi host's storage system. Default is None.
    '''

    if not hostname:
        hostname = get_managed_object_name(host_ref)
    if not storage_system:
        storage_system = get_storage_system(service_instance, host_ref,
                                            hostname)

    traversal_spec = vmodl.query.PropertyCollector.TraversalSpec(
        path='configManager.storageSystem',
        type=vim.HostSystem,
        skip=False)
    results = get_mors_with_properties(service_instance,
                                       vim.HostStorageSystem,
                                       ['storageDeviceInfo.scsiLun'],
                                       container_ref=host_ref,
                                       traversal_spec=traversal_spec)
    if not results:
        raise salt.exceptions.VMwareObjectRetrievalError(
            'Host\'s \'{0}\' devices were not retrieved'.format(hostname))
    log.trace(
        '[%s] Retrieved %s devices: %s',
        hostname,
        len(results[0].get('storageDeviceInfo.scsiLun', [])),
        ', '.join([l.canonicalName for l in
                   results[0].get('storageDeviceInfo.scsiLun', [])])
    )
    disks = [l for l in results[0].get('storageDeviceInfo.scsiLun', [])
             if isinstance(l, vim.HostScsiDisk) and
             l.canonicalName == disk_id]
    if not disks:
        raise salt.exceptions.VMwareObjectRetrievalError(
            'Disk \'{0}\' was not found in host \'{1}\''
            ''.format(disk_id, hostname))
    log.trace('[%s] device_path = %s', hostname, disks[0].devicePath)
    # Erase the partitions by setting an empty partition spec
    try:
        storage_system.UpdateDiskPartitions(disks[0].devicePath,
                                            vim.HostDiskPartitionSpec())
    except vim.fault.NoPermission as exc:
        log.exception(exc)
        raise salt.exceptions.VMwareApiError(
            'Not enough permissions. Required privilege: '
            '{0}'.format(exc.privilegeId))
    except vim.fault.VimFault as exc:
        log.exception(exc)
        raise salt.exceptions.VMwareApiError(exc.msg)
    except vmodl.RuntimeFault as exc:
        log.exception(exc)
        raise salt.exceptions.VMwareRuntimeError(exc.msg)
    log.trace('[%s] Erased partitions on disk \'%s\'', hostname, disk_id)