26
26
- Russell Teague (@mtnbikenc)
27
27
- Abhijeet Kasurde (@Akasurde)
28
28
- Christian Kotte (@ckotte)
29
+ - Nina Loser (@Nina2244)
29
30
notes:
30
31
- The option O(device) need to be used with DHCP because otherwise it's not possible to check if a VMkernel device is already present
31
32
- You can only change from DHCP to static, and vSS to vDS, or vice versa, in one step, without creating a new device, with O(device) specified.
139
140
- This option is only allowed if the default TCP/IP stack is used.
140
141
type: bool
141
142
default: false
143
+ enable_backup_nfc:
144
+ description:
145
+ - Enable vSphere Backup NFC traffic on the VMKernel adapter.
146
+ - This option is only allowed if the default TCP/IP stack is used.
147
+ type: bool
148
+ default: false
142
149
state:
143
150
description:
144
151
- If set to V(present), the VMKernel adapter will be created with the given specifications.
@@ -301,6 +308,7 @@ def __init__(self, module):
301
308
self .enable_provisioning = self .params ['enable_provisioning' ]
302
309
self .enable_replication = self .params ['enable_replication' ]
303
310
self .enable_replication_nfc = self .params ['enable_replication_nfc' ]
311
+ self .enable_backup_nfc = self .params ['enable_backup_nfc' ]
304
312
305
313
self .vswitch_name = self .params ['vswitch_name' ]
306
314
self .vds_name = self .params ['dvswitch_name' ]
@@ -494,7 +502,7 @@ def host_vmk_update(self):
494
502
"""
495
503
changed = changed_settings = changed_vds = changed_services = \
496
504
changed_service_vmotion = changed_service_mgmt = changed_service_ft = \
497
- changed_service_vsan = changed_service_prov = changed_service_rep = changed_service_rep_nfc = False
505
+ changed_service_vsan = changed_service_prov = changed_service_rep = changed_service_rep_nfc = changed_service_backup_nfc = False
498
506
changed_list = []
499
507
results = dict (changed = False , msg = '' )
500
508
@@ -623,6 +631,11 @@ def host_vmk_update(self):
623
631
if (self .enable_replication_nfc and self .vnic .device not in service_type_vmks ['vSphereReplicationNFC' ]) or \
624
632
(not self .enable_replication_nfc and self .vnic .device in service_type_vmks ['vSphereReplicationNFC' ]):
625
633
changed_services = changed_service_rep_nfc = True
634
+
635
+ if (self .enable_backup_nfc and self .vnic .device not in service_type_vmks ['vSphereBackupNFC' ]) or \
636
+ (not self .enable_backup_nfc and self .vnic .device in service_type_vmks ['vSphereBackupNFC' ]):
637
+ changed_services = changed_service_backup_nfc = True
638
+
626
639
if changed_services :
627
640
changed_list .append ("services" )
628
641
@@ -744,6 +757,14 @@ def host_vmk_update(self):
744
757
vnic_manager = vnic_manager , vmk = self .vnic , service_type = 'vSphereReplicationNFC' , operation = operation
745
758
)
746
759
760
+ if changed_service_backup_nfc :
761
+ if self .vnic .device in service_type_vmks ['vSphereBackupNFC' ]:
762
+ services_previous .append ('Backup_NFC' )
763
+ operation = 'select' if self .enable_backup_nfc else 'deselect'
764
+ self .set_service_type (
765
+ vnic_manager = vnic_manager , vmk = self .vnic , service_type = 'vSphereBackupNFC' , operation = operation
766
+ )
767
+
747
768
if changed_service_vsan :
748
769
if self .vnic .device in service_type_vmks ['vsan' ]:
749
770
services_previous .append ('VSAN' )
@@ -918,7 +939,7 @@ def host_vmk_create(self):
918
939
option is False for option in [self .enable_vsan , self .enable_vmotion ,
919
940
self .enable_mgmt , self .enable_ft ,
920
941
self .enable_provisioning , self .enable_replication ,
921
- self .enable_replication_nfc ]):
942
+ self .enable_replication_nfc , self . enable_backup_nfc ]):
922
943
self .vnic = self .get_vmkernel_by_device (device_name = vmk_device )
923
944
924
945
# VSAN
@@ -945,6 +966,9 @@ def host_vmk_create(self):
945
966
if self .enable_replication_nfc :
946
967
self .set_service_type (host_vnic_manager , self .vnic , 'vSphereReplicationNFC' )
947
968
969
+ if self .enable_backup_nfc :
970
+ self .set_service_type (host_vnic_manager , self .vnic , 'vSphereBackupNFC' )
971
+
948
972
self .module .exit_json (** results )
949
973
950
974
def set_service_type (self , vnic_manager , vmk , service_type , operation = 'select' ):
@@ -984,6 +1008,7 @@ def get_all_vmks_by_service_type(self):
984
1008
vSphereProvisioning = [],
985
1009
vSphereReplication = [],
986
1010
vSphereReplicationNFC = [],
1011
+ vSphereBackupNFC = [],
987
1012
)
988
1013
989
1014
for service_type in list (service_type_vmk ):
@@ -1037,6 +1062,8 @@ def create_enabled_services_string(self):
1037
1062
services .append ('Repl' )
1038
1063
if self .enable_replication_nfc :
1039
1064
services .append ('Repl_NFC' )
1065
+ if self .enable_backup_nfc :
1066
+ services .append ('Backup_NFC' )
1040
1067
return ', ' .join (services )
1041
1068
1042
1069
@staticmethod
@@ -1075,6 +1102,7 @@ def main():
1075
1102
enable_provisioning = dict (type = 'bool' , default = False ),
1076
1103
enable_replication = dict (type = 'bool' , default = False ),
1077
1104
enable_replication_nfc = dict (type = 'bool' , default = False ),
1105
+ enable_backup_nfc = dict (type = 'bool' , default = False ),
1078
1106
vswitch_name = dict (required = False , type = 'str' , aliases = ['vswitch' ]),
1079
1107
dvswitch_name = dict (required = False , type = 'str' , aliases = ['dvswitch' ]),
1080
1108
network = dict (
0 commit comments