创建受密码保护的Samba存储池

问题描述 投票:0回答:1
<pool type="netfs">
  <name>virtimages</name>
  <source>
    <host name="0.0.0.0"/>
    <dir path="/var/lib/virt/images"/>
    <format type='cifs'/>
  </source>
  <target>
    <path>/var/lib/virt/images</path>
  </target>
</pool>

以上libvirt XML配置可用于创建Samba存储池,但是如何创建受密码保护的Samba存储池?

python api libvirt
1个回答
0
投票

您必须在源代码中添加一个auth部分,例如:

  <name>YourStorage</name>
  <source>
    <host name="storage.example.com" />
    <dir path="/backup" />
    <format type="cifs" />
    <auth type='chap' username='SomeSecretUsername'>
      <secret usage='SomeSecretPass'/>
    </auth>
  </source>
  <target>
    <path>/mnt/storage</path>
  </target>
</pool>```

See: https://libvirt.org/formatstorage.html#StoragePoolSource
© www.soinside.com 2019 - 2024. All rights reserved.