Storage connectivity groups (SCGs) define settings that control volume attachment to virtual machines (VMs), including the connectivity type for boot and data volumes, physical Fibre Channel port restrictions, fabrics, and redundancy requirements for VIOSes, ports and fabrics.
A storage connectivity group lists a set of VIOSes that are allowed to participate in volume connectivity. While deploying a VM, you must specify the storage connectivity group. Typically, the VM remains associated with the storage connectivity group during its life cycle. However, there might be cases when you need to change the storage connectivity group associated with a virtual machine.
PowerVC 188.8.131.52 has a new utility ‘powervc-edit-scg’that allows you to change the storage connectivity group associated with a virtual machine. The utility can be found under /opt/ibm/powervc/bin/.
powervc-edit-scg [-h] powervc-edit-scg [-u user] -i instance_id -s scg_id [--force] The powervc-edit-scg command is used to edit the Storage Connectivity Group on a virtual machine. optional arguments: -h, --help show this help message and exit -i INSTANCE, --instance INSTANCE specifies the instance uuid for which the scg has to be changed. -u USER_NAME, --user USER_NAME The PowerVC user that should be used for the authentication necessary to capture certain diagnostics. If this is not specified, the user name is obtained from the OS_USERNAME environment variable or assumed from whoami. -s SCG, --scg SCG specifies the scg id to be set -f, --force The force flag sets the given Storage Connectivity Group on the VM. Warning: Please note force setting the SCG on a VM would affect future volume attachments on the VM and live-migration if the right fabric or vios are not selected.
USE CASE 1:
If ‘x’ SCG is associated with a virtual machine and you want to change the SCG association from ‘x’ to ‘y’, then you can leverage the utility of CLI command,
USE CASE 2:
While importing a virtual machine from another management system, you can change the associated SCG to that VM using
Let’s see the procedure for editing an SCG.
1. On the virtual machine details page, choose to edit the VM and you can see the VM ID .
2. To get the ID of the new SCG go to Configuration -> Storage Connectivity Groups and click on the new SCG. Note the SCG ID.
If the new SCG has additional ports or VIOS then any further volume attachment will use the new settings. This would mean changes to the existing zones wherever applicable.
While editing an SCG, the CLI validates connectivity types, VIOS members and fabrics. If the new SCG does not comply, then the
powervc-edit-scg command fails.
For example, here we are trying to change the SCG with boot: NPIV data:NPIV to boot: VSCSI data:NPIV and that fails.
When we attempt to change fabrics access from ‘at least one fabric per VIOS’ to ‘every fabric per VIOS’ or any such combination in SCG, it fails.
With different fabrics you will see:
With different number of VIOSes you will see:
[root@ip9-114-192-165 ~]# powervc-edit-scg -i de7cab16-8893-48c7-a247-622e8007bd25 -s d202ae5a-bb43-4863-b15c-13ca81280b9b Enter password for root: [u"Changing the storage connectivity group associated with virtual machine 'prt-vm-scg-2-de7cab16-00000002' to one without at least the same set of Virtual I/O Server members is not allowed."]
A user can “force” set the new SCG if they believe the VM still complies with the VIOS, fabric and connectivity requirements. This is usually the case when an existing VM was managed by PowerVC and a SCG was automatically assigned to the VM. In this scenario, an administrator can edit the auto assigned SCG to a more suitable one as per their environment.
When using the “force” flag, make sure you do not set a wrong SCG on the VM as it might affect further volume attachments and live-migration.
Author: Preeti Duhan