Update create_vpg.py
typo in vm name
This commit is contained in:
@@ -10,7 +10,7 @@ Prerequisites:
|
|||||||
2. Update prerequisites/config.py with your ZVM details
|
2. Update prerequisites/config.py with your ZVM details
|
||||||
|
|
||||||
Usage:
|
Usage:
|
||||||
python create_vpg.py --vm-names "vm1" "vm2" "vm3" [--vpg-name "My-VPG"]
|
python create_vpg.py [--vm-name "vm1"] [--vpg-name "My-VPG"]
|
||||||
|
|
||||||
This solution demonstrates:
|
This solution demonstrates:
|
||||||
- Creating a new VPG with basic settings
|
- Creating a new VPG with basic settings
|
||||||
@@ -70,7 +70,7 @@ def main():
|
|||||||
# Step 1: Create a ZVMLClient instance
|
# Step 1: Create a ZVMLClient instance
|
||||||
logging.info(f"Initializing ZVMLClient for ZVM at {ZVM_HOST}")
|
logging.info(f"Initializing ZVMLClient for ZVM at {ZVM_HOST}")
|
||||||
parser = argparse.ArgumentParser(description='Create VPG and add specified VMs')
|
parser = argparse.ArgumentParser(description='Create VPG and add specified VMs')
|
||||||
parser.add_argument('--vm-name', default="CRM-3",
|
parser.add_argument('--vm-name', default="CRM-03",
|
||||||
help='VM name to add to the VPG')
|
help='VM name to add to the VPG')
|
||||||
parser.add_argument('--vpg-name', default="Test-VPG-Python",
|
parser.add_argument('--vpg-name', default="Test-VPG-Python",
|
||||||
help='Name of the VPG to create (default: Test-VPG-Python)')
|
help='Name of the VPG to create (default: Test-VPG-Python)')
|
||||||
@@ -147,20 +147,6 @@ def main():
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Network settings
|
|
||||||
networks = {
|
|
||||||
"Failover": {
|
|
||||||
"Hypervisor": {
|
|
||||||
"DefaultNetworkIdentifier": target_network.get('NetworkIdentifier')
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"FailoverTest": {
|
|
||||||
"Hypervisor": {
|
|
||||||
"DefaultNetworkIdentifier": target_network.get('NetworkIdentifier')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Step 5: Create VPG
|
# Step 5: Create VPG
|
||||||
vpg_id = client.vpgs.create_vpg(basic=basic, journal=journal, recovery=recovery, networks=networks, sync=True)
|
vpg_id = client.vpgs.create_vpg(basic=basic, journal=journal, recovery=recovery, networks=networks, sync=True)
|
||||||
logging.info(f'vpg {args.vpg_name} successfully created, vpg_id is {vpg_id}')
|
logging.info(f'vpg {args.vpg_name} successfully created, vpg_id is {vpg_id}')
|
||||||
|
|||||||
Reference in New Issue
Block a user