'Create the archive by first creating a uniquely named directory in the
current working directory, adding the log files and debug information,
creating a ``tar`` archive from the directory and finally removing the
directory.'

def create(self):

    os.makedirs(self._archive_path)
    try:
        with self._open_logfile('flocker-version') as output:
            output.write((__version__.encode('utf-8') + '\n'))
        services = self._service_manager.flocker_services()
        for (service_name, service_status) in services:
            self._log_exporter.export_flocker(service_name=service_name, target_path=self._logfile_path(service_name))
        self._log_exporter.export_all(self._logfile_path('syslog'))
        with self._open_logfile('service-status') as output:
            services = self._service_manager.all_services()
            for (service_name, service_status) in services:
                output.write((((service_name + '    ') + service_status) + '\n'))
        check_call(['docker', 'version'], stdout=self._open_logfile('docker-version'))
        check_call(['docker', 'info'], stdout=self._open_logfile('docker-info'))
        self._open_logfile('uname').write('    '.join(os.uname()))
        self._open_logfile('os-release').write(open('/etc/os-release').read())
        check_call(['ip', 'addr'], stdout=self._open_logfile('ip-addr'))
        self._open_logfile('hostname').write((gethostname() + '\n'))
        check_call(['fdisk', '-l'], stdout=self._open_logfile('fdisk'))
        check_call(['lsblk', '--all'], stdout=self._open_logfile('lsblk'))
        self._open_logfile('lshw').write(list_hardware())
        archive_path = make_archive(base_name=self._archive_name, format='tar', root_dir=os.path.dirname(self._archive_path), base_dir=os.path.basename(self._archive_path))
    finally:
        rmtree(self._archive_path)
    return archive_path
