salt.modules.lvs

Support for LVS (Linux Virtual Server)

salt.modules.lvs.add_server(protocol=None, service_address=None, server_address=None, packet_forward_method='dr', weight=1, **kwargs)

Add a real server to a virtual service.

protocol
The service protocol(only support tcp, udp and fwmark service).
service_address
The LVS service address.
server_address
The real server address.
packet_forward_method
The LVS packet forwarding method(dr for direct routing, tunnel for tunneling, nat for network access translation).
weight
The capacity of a server relative to the others in the pool.

CLI 范例:

salt '*' lvs.add_server tcp 1.1.1.1:80 192.168.0.11:8080 nat 1
salt.modules.lvs.add_service(protocol=None, service_address=None, scheduler='wlc')

Add a virtual service.

protocol
The service protocol(only support tcp, udp and fwmark service).
service_address
The LVS service address.
scheduler
Algorithm for allocating TCP connections and UDP datagrams to real servers.

CLI 范例:

salt '*' lvs.add_service tcp 1.1.1.1:80 rr
salt.modules.lvs.check_server(protocol=None, service_address=None, server_address=None, **kwargs)

Check the real server exists in the specified service.

CLI 范例:

salt '*' lvs.check_server tcp 1.1.1.1:80 192.168.0.11:8080
salt.modules.lvs.check_service(protocol=None, service_address=None, **kwargs)

Check the virtual service exists.

CLI 范例:

salt '*' lvs.check_service tcp 1.1.1.1:80
salt.modules.lvs.clear()

Clear the virtual server table

CLI 范例:

salt '*' lvs.clear
salt.modules.lvs.delete_server(protocol=None, service_address=None, server_address=None)

Delete the realserver from the virtual service.

protocol
The service protocol(only support tcp, udp and fwmark service).
service_address
The LVS service address.
server_address
The real server address.

CLI 范例:

salt '*' lvs.delete_server tcp 1.1.1.1:80 192.168.0.11:8080
salt.modules.lvs.delete_service(protocol=None, service_address=None)

Delete the virtual service.

protocol
The service protocol(only support tcp, udp and fwmark service).
service_address
The LVS service address.

CLI 范例:

salt '*' lvs.delete_service tcp 1.1.1.1:80
salt.modules.lvs.edit_server(protocol=None, service_address=None, server_address=None, packet_forward_method=None, weight=None, **kwargs)

Edit a real server to a virtual service.

protocol
The service protocol(only support tcp, udp and fwmark service).
service_address
The LVS service address.
server_address
The real server address.
packet_forward_method
The LVS packet forwarding method(dr for direct routing, tunnel for tunneling, nat for network access translation).
weight
The capacity of a server relative to the others in the pool.

CLI 范例:

salt '*' lvs.edit_server tcp 1.1.1.1:80 192.168.0.11:8080 nat 1
salt.modules.lvs.edit_service(protocol=None, service_address=None, scheduler=None)

Edit the virtual service.

protocol
The service protocol(only support tcp, udp and fwmark service).
service_address
The LVS service address.
scheduler
Algorithm for allocating TCP connections and UDP datagrams to real servers.

CLI 范例:

salt '*' lvs.edit_service tcp 1.1.1.1:80 rr
salt.modules.lvs.get_rules()

Get the virtual server rules

CLI 范例:

salt '*' lvs.get_rules
salt.modules.lvs.list(protocol=None, service_address=None)

List the virtual server table if service_address is not specified. If a service_address is selected, list this service only.

CLI 范例:

salt '*' lvs.list
salt.modules.lvs.zero(protocol=None, service_address=None)

Zero the packet, byte and rate counters in a service or all services.

CLI 范例:

salt '*' lvs.zero