def virtual_drive_create(handle, drive_group, controller_type, controller_slot, raid_level=0, virtual_drive_name=None, access_policy="read-write", read_policy="no-read-ahead", cache_policy="direct-io", disk_cache_policy="unchanged", write_policy="Write Through", strip_size="64k", size=None, self_encrypt=False, server_id=1): """ Creates virtual drive from unused physical drives Args: handle (ImcHandle) drive_group (list of lists): list of drives [[1]] [[1,2]] [[1,2],[3,4]] controller_type (str): Controller type 'SAS' controller_slot (str): Controller slot name/number "MEZZ","0"-"9", "HBA" virtual_drive_name (str): Name of the virtual drive raid_level (int): raid level 0, 1, 5, 6, 10, 50, 60 Raid 0 Simple striping. Raid 1 Simple mirroring. Raid 5 Striping with parity. Raid 6 Striping with two parity drives. Raid 10 Spanned mirroring. Raid 50 Spanned striping with parity. Raid 60 Spanned striping with two parity drives. access_policy (str): Access-policy for the virtual drive ['read-write', 'read-only', 'hidden', 'default', 'blocked'] self_encrypt (bool): Encrypt the virtual drive if the underlying controller and physical drive support it Returns: StorageVirtualDrive object Examples: virtual_drive_create(handle=imc, drive_group=[[2]], controller_slot='MEZZ') """ slot_dn = _get_controller_dn(handle, controller_type, controller_slot, server_id) dg_str = _list_to_string(drive_group) vdn = virtual_drive_name params = {} params["parent_mo_or_dn"] = slot_dn params["drive_group"] = dg_str params["raid_level"] = str(raid_level) params["access_policy"] = access_policy params["read_policy"] = read_policy params["cache_policy"] = cache_policy params["disk_cache_policy"] = disk_cache_policy params["write_policy"] = write_policy params["strip_size"] = strip_size if self_encrypt: params["admin_action"] = "enable-self-encrypt" params["virtual_drive_name"] = \ (vd_name_derive(raid_level, drive_group), vdn)[vdn is not None] params["size"] = (_vd_max_size_get(handle=handle, controller_type=controller_type, controller_slot=controller_slot, drive_list=drive_group, raid_level=raid_level, server_id=server_id), size)[size is not None] mo = vd_creator(**params) mo.admin_state = "trigger" handle.add_mo(mo) return mo
def vd_create_using_unused_pds(handle, drive_group, controller_type, controller_slot, raid_level=0, virtual_drive_name=None, access_policy="read-write", read_policy="no-read-ahead", cache_policy="direct-io", disk_cache_policy="unchanged", write_policy="Write Through", strip_size="64k", size=None, self_encrypt=False, server_id=1): """ Creates virtual drive from unused physical drives Args: handle (ImcHandle) drive_group (list of lists): list of drives [[1]] [[1,2]] [[1,2],[3,4]] controller_type (str): Controller type 'SAS' controller_slot (str): Controller slot name/number "MEZZ","0"-"9", "HBA" raid_level (int): raid level 0, 1, 5, 6, 10, 50, 60 Raid 0 Simple striping. Raid 1 Simple mirroring. Raid 5 Striping with parity. Raid 6 Striping with two parity drives. Raid 10 Spanned mirroring. Raid 50 Spanned striping with parity. Raid 60 Spanned striping with two parity drives. virtual_drive_name (str): Name of the virtual drive access_policy (str): Access-policy for the virtual drive ['read-write', 'read-only', 'hidden', 'default', 'blocked'] read_policy (str): Read Policy for the virtual drive. ["always-read-ahead", "no-read-ahead"] cache_policy (str): Cache policy used for buffering reads. ["cached-io", "direct-io"] disk_cache_policy: Disk cache policy. ["disabled", "enabled", "unchanged"] write_policy: Write policy ["always-write-back", "write-back-good-bbu", "write-through"] strip_size: Size of each strip ["1024k", "128k", "16k", "256k", "32k", "512k", "64k", "8k"] size: The size of the virtual drive you want to create. Enter a value and select one of the following units - MB,GB,TB e.g. '100 MB' or '20 GB' or '1 TB' self_encrypt (bool): Encrypt the virtual drive if the underlying controller and physical drive support it server_id (int): Specify server id for UCS C3260 modular servers Returns: None Examples: vd_create_using_unused_pds(handle=imc, drive_group=[[2]], controller_type = 'SAS', controller_slot='MEZZ') """ slot_dn = _get_controller_dn(handle, controller_type, controller_slot, server_id) dg_str = _list_to_string(drive_group) vdn = virtual_drive_name params = {} params["parent_mo_or_dn"] = slot_dn params["drive_group"] = dg_str params["raid_level"] = str(raid_level) params["access_policy"] = access_policy params["read_policy"] = read_policy params["cache_policy"] = cache_policy params["disk_cache_policy"] = disk_cache_policy params["write_policy"] = write_policy params["strip_size"] = strip_size if self_encrypt: params["admin_action"] = "enable-self-encrypt" params["virtual_drive_name"] = \ (vd_name_derive(raid_level, drive_group), vdn)[vdn is not None] params["size"] = (_vd_max_size_get(handle=handle, controller_type=controller_type, controller_slot=controller_slot, drive_list=drive_group, raid_level=raid_level, server_id=server_id), size)[size is not None] mo = vd_creator(**params) mo.admin_state = "trigger" handle.add_mo(mo)