April 2018
Intermediate to advanced
280 pages
8h 37m
English
A security group can be assigned to a VM by invoking the add_security_group_to_server() function call and passing the VM instance ID and security group ID to it as parameters:
def assign_security_group_to_vm(conn): server_id="7cdaa375-f1b5-40ab-81bd-7e3d052f370d" security_group_id="4bffd353-78ec-4868-8e9b-35e2edc45cdd" conn.compute.add_security_group_to_server(server_id, security_group_id)