FileNotFoundError: [Errno 2] No such file or directory: while deleting the minidcos vagrant cluster

FileNotFoundError: [Errno 2] No such file or directory: while deleting the minidcos vagrant cluster

我已经使用以下命令创建了本地 minidcos vagrant 集群。

    $ sudo minidcos vagrant create ./dcos_generate_config.sh --agents 0

以上命令没有成功。由于 No space left on device.

突然失败

当我列出集群时,我看到集群存在。

    $ sudo minidcos vagrant  list
    default

我无法使用 sudo minidcos vagrant web 访问集群。当我尝试销毁集群时出现相同的错误,如下所示 -

    $ sudo minidcos vagrant  destroy
    Traceback (most recent call last):
    File "/usr/local/bin/minidcos", line 10, in <module>
        sys.exit(minidcos())
    File "/usr/local/lib/python3.7/site-packages/click/core.py", line 764, in __call__
        return self.main(*args, **kwargs)
    File "/usr/local/lib/python3.7/site-packages/click/core.py", line 717, in main
        rv = self.invoke(ctx)
    File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
    File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
    File "/usr/local/lib/python3.7/site-packages/click/core.py", line 956, in invoke
        return ctx.invoke(self.callback, **ctx.params)
    File "/usr/local/lib/python3.7/site-packages/click/core.py", line 555, in invoke
        return callback(*args, **kwargs)
    File "/usr/local/lib/python3.7/site-packages/dcos_e2e_cli/dcos_vagrant/commands/destroy.py", line 59, in destroy
        cluster_vms.destroy()
    File "/usr/local/lib/python3.7/site-packages/dcos_e2e_cli/dcos_vagrant/commands/_common.py", line 294, in destroy
        self.vagrant_client.destroy()
    File "/usr/local/lib/python3.7/site-packages/dcos_e2e_cli/dcos_vagrant/commands/_common.py", line 274, in vagrant_client
        item for item in self.workspace_dir.iterdir()
    File "/usr/local/lib/python3.7/site-packages/dcos_e2e_cli/dcos_vagrant/commands/_common.py", line 274, in <listcomp>
        item for item in self.workspace_dir.iterdir()
    File "/usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/pathlib.py", line 1074, in iterdir
        for name in self._accessor.listdir(self):
    FileNotFoundError: [Errno 2] No such file or directory: '/tmp/acaa37838a534dc0ae51c3fcc059f650'

如何才能成功删除集群?

这里的问题是工作区目录被删除了,但仍然检测到虚拟机。 工作区可根据 the documentation.

配置

这可能是因为工作区目录在 VM 处于 运行 时以某种方式被删除,但当主机关闭时也会发生(假设使用默认工作区临时目录)。

minidcos 版本 2019.04.08.1 开始,行为现已更改。 特别是,minidcos vagrant list 不再列出不处于 运行 状态的虚拟机。 还有一个新的 minidcos vagrant clean 命令可以清除所有 VM 和剩余的 VM。