From 437fc3f3b004611c21a89cff413b811eb9ea501c Mon Sep 17 00:00:00 2001 From: Christopher Voltz Date: Sun, 14 Jun 2020 20:00:15 -0500 Subject: [PATCH] Add WWN support Add the disk attribute wwn to set the WWN of a disk drive. Signed-off-by: christopher@voltz.us --- README.md | 1 + lib/vagrant-libvirt/config.rb | 3 ++- lib/vagrant-libvirt/templates/domain.xml.erb | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ee8ee14..08330a0 100644 --- a/README.md +++ b/README.md @@ -777,6 +777,7 @@ It has a number of options: Disks with this option set to true need to be removed manually. * `shareable` - Set to true if you want to simulate shared SAN storage. * `serial` - Serial number of the disk device. +* `wwn` - WWN number of the disk device. The following example creates two additional disks. diff --git a/lib/vagrant-libvirt/config.rb b/lib/vagrant-libvirt/config.rb index b8c3f37..f72a74b 100644 --- a/lib/vagrant-libvirt/config.rb +++ b/lib/vagrant-libvirt/config.rb @@ -600,7 +600,8 @@ module VagrantPlugins cache: options[:cache] || 'default', allow_existing: options[:allow_existing], shareable: options[:shareable], - serial: options[:serial] + serial: options[:serial], + wwn: options[:wwn] } @disks << disk # append diff --git a/lib/vagrant-libvirt/templates/domain.xml.erb b/lib/vagrant-libvirt/templates/domain.xml.erb index 7118987..118d2f7 100644 --- a/lib/vagrant-libvirt/templates/domain.xml.erb +++ b/lib/vagrant-libvirt/templates/domain.xml.erb @@ -127,6 +127,9 @@ <% if d[:serial] %> <%= d[:serial] %> <% end %> + <% if d[:wwn] %> + <%= d[:wwn] %> + <% end %> <%# this will get auto generated by Libvirt
-%>