Cache Calculator API (15 Jan 2004)

Embed Size (px)

Citation preview

  • 7/31/2019 Cache Calculator API (15 Jan 2004)

    1/22

    Symmwin

    Power and Cache Calculator Tool

    Application Program Interface

    (API)

    ** Rough Draft **

    ** Company Confidential **

    Written byMark Silvestri and Nirit Lvovsky

    SymmWin Group

    Date Printed: 15-Jan-2004

    Last Modified: 15-Jan-2004

    EMC Corporation171 South Street

    Hopkinton, MA 01748-9103

    Corporate Headquarters: (508) 435-1000, (800) 424-EMC2

    Fax: (508) 435-5374 Service: (800) SVC-4EMC

  • 7/31/2019 Cache Calculator API (15 Jan 2004)

    2/22

    - i -

    TABLE OF CONTENTS

    1. EXECUTIVE SUMMARY....................................................................................................................................... 5

    1.1 DESCRIPTION........................................................................................................................................................51.2 GOAL......................................................................................................................................................................51.3 AUDIENCE.............................................................................................................................................................51.4 RELATED DOCUMENTATION............................................................................................................................51.5 RELEASE NOTES...................................................................................................................................................61.6 DESCRIPTION OF TERMS USED..........................................................................................................................61.7 HOW TO READ THIS DOCUMENT .....................................................................................................................61.8 BACKUS-NAUR FORM (BNF) ..............................................................................................................................7

    1.8.1 Standard Syntactic Categories ..............................................................................................................7

    2. EXISTING SYSTEM............................................................................................................................................... 8

    2.1 EXISTING PROBLEMS...........................................................................................................................................82.2 DLL INTERFACE ...................................................................................................................................................8

    2.3 EXAMPLE OF WEB BASED INTERFACE ............................................................................................................92.3.1 Web Input Page........................................................................................................................................102.3.2 Web Report Page.....................................................................................................................................11

    2.4 BASIC OVERVIEW OF DATA MOVEMENT ......................................................................................................112.5 EXPECTATION....................................................................................................................................................11

    2.5.1 Look and Feel ..........................................................................................................................................122.5.2 Data Flow .................................................................................................................................................122.5.3 Working With Symmwin .........................................................................................................................12

    3. WORK TO BE DONE..........................................................................................................................................13

    3.1 PHASE I - DESIGN................................................................................................................................................133.1.1 Overview/Presentation...........................................................................................................................13 3.1.2 API Primitives Design.............................................................................................................................133.1.3 API One-Shot Solution Design .............................................................................................................133.1.4 Internal Data Structure Design............................................................................................................133.1.5 GUI.............................................................................................................................................................13

    3.2 PHASE II - IMPLEMENTATION/CODING.........................................................................................................133.2.1 API Library(s) ..........................................................................................................................................133.2.2 Symmwin DLL...........................................................................................................................................13

    3.3 PHASE III - DEBUG/TESTING.............................................................................................................................133.3.1 Standalone Test Application ................................................................................................................133.3.2 Automated Test Application..................................................................................................................133.3.3 Symmwin ...................................................................................................................................................14

    3.4 PHASE IV - RELEASE ..........................................................................................................................................143.5 PHASE V - IMPROVE SYSTEM...........................................................................................................................14

    4. POWER AND CACHE CALCULATOR - VERSION 6.5 ..............................................................................15 4.1 OVERVIEW...........................................................................................................................................................154.2 CHANGES FROM 6.0............................................................................................................................................154.3 API .......................................................................................................................................................................15

    4.3.1 CalcCacheXml()......................................................................................................................................154.3.2 XML Specific Syntactical Categories..................................................................................................164.3.3 Tag Listing (DLL Input).........................................................................................................................174.3.4 Tag Listing (DLL Output)......................................................................................................................184.3.5 XML Examples .........................................................................................................................................18

  • 7/31/2019 Cache Calculator API (15 Jan 2004)

    3/22

    - ii -

    4.3.6 Restrict ions...............................................................................................................................................194.4 REMAINING ISSUES.............................................................................................................................................19

    4.4.1 Illegal XML Returned in Error XML....................................................................................................194.5 EXAMPLE SCENARIOS.......................................................................................................................................19

    5. POWER AND CACHE CALCULATOR - VERSION 7+...............................................................................20

    5.1 OVERVIEW...........................................................................................................................................................205.2 CHANGES FROM 6.5............................................................................................................................................205.3 API .......................................................................................................................................................................205.4 REMAINING ISSUES.............................................................................................................................................205.5 EXAMPLE SCENARIOS.......................................................................................................................................20

    6. KNOWN SYSTEM ISSUES................................................................................................................................21

    6.1 SEVERITY ONE ISSUES.......................................................................................................................................216.1.1 ..........................................................................................................................................21

    6.2 SEVERITY TWO ISSUES......................................................................................................................................216.2.1 ..........................................................................................................................................21

    6.3 SEVERITY THREE ISSUES..................................................................................................................................216.3.1 ..........................................................................................................................................21

  • 7/31/2019 Cache Calculator API (15 Jan 2004)

    4/22

    - iii -

    TABLE OF FIGURES

    Figure 1 - Existing DLL Interface..................................................................................................................................8Figure 2 - Example VB Call to DLL Interface...............................................................................................................9Figure 3 - Example of Web Based Interface..............................................................................................................10

    Figure 4 - Example of Web Based Output.................................................................................................................11Figure 5 - Data Flow.....................................................................................................................................................11Figure 6 - Design Data Flow Expectation..................................................................................................................12Figure 7 - Implementation with Symmwin.................................................................................................................12Figure 8 - Version 6.5 DLL Interface..........................................................................................................................15Figure 9 - Version 7 DLL Interface.............................................................................................................................20

  • 7/31/2019 Cache Calculator API (15 Jan 2004)

    5/22

    - iv -

    TABLE OF TABLESTable 1 - Release Notes ................................................................................................................................................. 6Table 2 - Description of Terms .....................................................................................................................................6Table 3 - XML Syntactical Categories ......................................................................................................................16Table 4 - XML Tag Listing of DLL Input..................................................................................................................17

    Table 5 - XML Tag Listing of DLL Output...............................................................................................................18

  • 7/31/2019 Cache Calculator API (15 Jan 2004)

    6/22

    Mark Silvestri Page 5 1/

    1. Executive Summary

    1.1 Description

    This document describes the Power and Cache Calculator tool. It describes how the system works today, how it willwork in the near future, as well as how it will work upon completion of its next major release.

    As of November 2003, the Symmwin group has taken control of the Power and Cache Calculator tool. The existing

    problems include:

    Different formulas are used across different platforms

    Getting new data out to user is slow

    Need to "hide" certain data from partners

    1.2 Goal

    The goal of this project is to provide a reasonably simple tool to be used throughout EMC to calculate cache andpower requirements for a Symmetrix. It is expected that upon completion, all users (Sales, Symmwin, Engineering,

    etc.) will switch to use this new single format.

    1.3 Audience

    The primary audience of this document includes:

    Users of the Power and Cache Calculator

    It is understood that the reader of this document has a solid working knowledge of:

    Basic Symmetrix Systems

    Specific Expertise in Symmetrix: Data Protection

    Drives

    SRDFA

    Virtual Devices

    Cache Boards

    Basic Windows 2000

    Basic Programming terminology (COM, DCOM, Threads, process, etc.)

    1.4 Related Documentation

    CacheCalculator IDL, EMC

    \\starfleet\eng\symmwin_group\projects \cache_calculator

    (Requires Microsoft Visual C++)

  • 7/31/2019 Cache Calculator API (15 Jan 2004)

    7/22

    Mark Silvestri Page 6 1/15/2004

    1.5 Release Notes

    Date Revision Author Description

    ?? ??? ?? ?.? MWS Original Document.

    Table 1 - Release Notes

    1.6 Description of Terms Used

    Term/Expression Definition/Usage

    COM Common Object Model

    DCOM Distributed Common Object Model

    GUI Graphical User Interface (e.g., a Window)

    Table 2 - Description of Terms

    1.7 How to Read This Document

    Items you enter or example code will be in this font:

    ShowMessage 'Completed First Calculation'

    Keys that should be pressed on the keyboard will be shown this way:

    , ,

    Buttons on the screen which should be pressed with the mouse will be displayed this way:

    [Next], [OK], [Calculate]

    Shaded sections are items that have not been implemented.

    This applies to the explicit API calls only.

    Sections that look like this are comments from the author(s). These comments generally raise issues that need to be

    addressed by someone other than the author(s).

  • 7/31/2019 Cache Calculator API (15 Jan 2004)

    8/22

    Mark Silvestri Page 7 1/15/2004

    1.8 Backus-Naur Form (BNF)

    The standard technique for defining the syntax of a language is to use Backus-Naur Form (BNF). The variant used

    here is as follows:

    Words inside double -quotes ("word") represent literal words themselves (these are called terminals). The phrase

    "double-quote" is used to represent the double-quote character itself. For example: "if". Words outside double-quotes (possibly with underscores) represent syntactic categories (i.e., nonterminals).

    For example: if_statement.

    Syntactic categories are defined using the form:

    syntactic_category ::= definition

    Square brackets ([]) surround optional items.

    Curly brackets ({}) surround items that can repeat zero or more times.

    A vertical line (|) separates alternatives.

    1.8.1 Standard Syntactic Categories

    Digit ::= "0"|"1"|"2"|"3"|"4"|"5"|"6"|"7"|"8"|"9"

    Sign ::= "+"|"-"Space ::= " "

    Alpha ::= "a"|"b"|..|"y"|"z"|"A"|"B"|..|"Y"|"Z"

    Integer ::= Digit{Digit}

    Variable ::= Alpha

    Number ::= [Sign]Integer[.Integer]

    String ::= ""{""|Alpha|Digit|Space|.}

  • 7/31/2019 Cache Calculator API (15 Jan 2004)

    9/22

    Mark Silvestri Page 8 1/

    2. Existing System

    The existing system runs across three different system. All three are generated from separate source code. The three

    different systems are:

    Figure 1 - Existing DLL Interface

    Windows COM DLL

    Web Interface

    Standalone Application

    2.1 Existing Problems

    Many of the existing problems are:

    2.2 DLL Interface

    DLL

    DataCrunch

    DMX3000

    0

    8

    0

    0

    8

    Default

    0

    "

    OP146K

    MIRRORED

    576

    0

    "

    DMX3000

    0

    8

    0

    0

    8

    Default

    0

    "

    OP146K

    MIRRORED

    576

    0

    "

    XML XML

    I

    N

    PU

    T

    O

    UT

    P

    UT

  • 7/31/2019 Cache Calculator API (15 Jan 2004)

    10/22

    Mark Silvestri Page 9 1/15/2004

    The following example is all of the test code we received from we agreed to take over the code.

    Private Sub btnGetResults_Click()

    Dim strXml As String

    Dim objCache As New CacheComp.clsCache

    strXml = ""

    strXml = strXml & "DMX3000"

    strXml = strXml & "0"

    strXml = strXml & "8"

    strXml = strXml & "0"

    strXml = strXml & "0"

    strXml = strXml & "8"

    strXml = strXml & "Default"

    strXml = strXml & "0"

    strXml = strXml & ""

    strXml = strXml & "OP"

    strXml = strXml & "146K"

    strXml = strXml & "MIRRORED"

    strXml = strXml & "576"

    strXml = strXml & "0"strXml = strXml & ""

    strXml = strXml & ""

    strResult = objCache.calculatecache(strXml)

    MsgBox strResult

    End Sub

    Figure 2 - Example VB Call to DLL Interface

    Though there is not much code here, it does provide a simple example of how the DLL works. In a nutshell, you pass it an

    XML string with all your data and it passes back an XML string that contains all the necessary information pertaining to

    cache boards and power supplies.

    Issue: In running updating this program, we found a problems:

    1) The XML code returned was illegal XML code because the tags started with a numeric value

    instead of a character.

    2) The drivers were passed as "K" drives when they should be GB drives.

    2.3 Example of Web Based Interface

    The web based tool provides

  • 7/31/2019 Cache Calculator API (15 Jan 2004)

    11/22

    Mark Silvestri Page 10 1/15/2004

    2.3.1 Web Input Page

    The web input page looks like the following:

    Figure 3 - Example of Web Based Interface

    The biggest problem with the web page is the fact the drives are bound to a specific host record and this is just not

    the way it works in reality.

    Question: Do we want to set up the system so that volumes requested looks similar to that of

    Symmwin?

  • 7/31/2019 Cache Calculator API (15 Jan 2004)

    12/22

    Mark Silvestri Page 11 1/15/2004

    2.3.2 Web Report Page

    Below is an example of the web-based output.

    Figure 4 - Example of Web Based Output

    2.4 Basic Overview of Data Movement

    The data will be stored via a standard API call interface. The figure below shows how the data will move.

    Figure 5 - Data Flow

    2.5 Expectation

    This section will explain what the general expectations are of the new Power and Cache Calculator System.

  • 7/31/2019 Cache Calculator API (15 Jan 2004)

    13/22

    Mark Silvestri Page 12 1/15/2004

    2.5.1 Look and Feel

    It will also be required to be directly accessible from the Symmwin GUI.

    2.5.2 Data Flow

    It is expected the data in and out of the system will flow as follows.

    Figure 6 - Design Data Flow Expectation

    2.5.3 Working With Symmwin

    Figure 7 - Implementation with Symmwin

  • 7/31/2019 Cache Calculator API (15 Jan 2004)

    14/22

    Mark Silvestri Page 13 1/15/2004

    3. Work to be done

    3.1 Phase I - Design

    3.1.1 Overview/Presentation

    How the system will work. This should be a document describing the project as whole. What

    needs to be done and what will be the finished product.

    3.1.2 API Primitives Design

    3.1.3 API One-Shot Solution Design

    3.1.4 Internal Data Structure Design

    3.1.5 GUI

    It is expected that there will be no GUI whatsoever in this system. All GUIs will need to be

    generated by calling applications.

    3.2 Phase II - Implementation/Coding

    3.2.1 API Library(s)

    3.2.2 Symmwin DLL

    3.3 Phase III - Debug/Testing

    This is effectively a continuation of the implementation. However, it is a landmark when the code is far

    enough along that data can be retrieved from the system without getting any errors back.

    3.3.1 Standalone Test Application

    This testing will be the first major landmark of the entire project. It will show that the data can be

    logged to the database.

    3.3.2 Automated Test Application

  • 7/31/2019 Cache Calculator API (15 Jan 2004)

    15/22

    Mark Silvestri Page 14 1/15/2004

    3.3.2.1 Failure Testing

    This will test the ability of the system to correctly recognize invalid setups, configurations, etc. and

    report back that an error has occurred. The automated system should be written so that it can

    check numerous expected invalid configurations and trap them early on in the developmentprocess.

    3.3.3 Symmwin

    3.4 Phase IV - Release

    3.5 Phase V - Improve System

    This phase will:

    Issues raised since the release of the system

    Previously planned improvements

  • 7/31/2019 Cache Calculator API (15 Jan 2004)

    16/22

    Mark Silvestri Page 15 1/15

    4. Power and Cache Calculator - Version 6.5

    This chapter describes the exactly what and how the system will work for release 6.5. It will include specific API calls,

    4.1 Overview

    This code will still be a "one-shot" solution where all data is passed in a single function call and all the return data is

    returned from the one function call. This is similar to the XML solution, except removes all the XML parsing that is

    required.

    Figure 8 - Version 6.5 DLL Interface

    4.2 Changes from 6.0

    4.3 API

    4.3.1 CalcCacheXml()

    Description Takes an XML configuration string and returns an XML configuration string

    Syntax clsCache.CalcCacheXml(const inputStr: WideString): WideString;

    Settings inputStr : valid XML string meeting the requirements stated

    Returns Valid XML string

    Remarks

    See Also

    Example

    DLL

    DataCrunch

    DMX3000

    0

    8

    0

    0

    8

    Default

    0

    "

    OP

    146K

    MIRRORED

    576

    0

    "

    DMX3000

    0

    8

    0

    0

    8

    Default

    0

    "

    OP

    146K

    MIRRORED

    576

    0

    "

    XML XML

    IN

    PU

    T

    O

    UTP

    UT

    API Function Callfunction LoadData(record struct) AP

    I API Function Callfunction LoadData(record struct)

    API

  • 7/31/2019 Cache Calculator API (15 Jan 2004)

    17/22

    Mark Silvestri Page 16 1/15/2004

    4.3.2 XML Specific Syntactical Categories

    DriveSize ::= "73" | "146" | "300"

    Platform ::= "6.0" | "6.5"

    Protection ::= "BCV" | "HLM" | "SPARE" | "SRDF" | "MIR" | "RAID 3+1" |

    "RAID 7+1" | "RAID10" | "RAID5-3" | "RAID5-7"

    HostType ::= "MF" | "OS"

    ModelPrefix ::= "DMX"

    ModelType ::= ModelPrefix "800"|"801"|"1000"|"1000-P"|"2000"|"2000-P"|"2000-

    3"|"2000-P3"|"3000"

    TagName ::= Alpha{Alpha|Digit}

    StartTag ::= ""

    EndTag ::= ""

    Table 3 - XML Syntactical Categories

  • 7/31/2019 Cache Calculator API (15 Jan 2004)

    18/22

    Mark Silvestri Page 17 1/15/2004

    4.3.3 Tag Listing (DLL Input)

    Tag Description

    Usage

    Valid Values Description

    Parameters Section [Required]

    params

    model ModelType The model number of the system

    platform Platform The specific platform (6.0 = DMX, 6.5 = DMX Mach 2)

    dae 1..8 The number of DAEs in the system

    fibrefed 1..8 The number of Fibre boards in the system

    ficonfed 1..4 The number of FICON boards in the system

    esconfed 1..4 The number of ESCON boards in the system

    fige 0..8 The number of FIGE boards in the system

    cacheboards 0..8 0 tells to calculate the best number of boards. (*Not working yet.)

    1..8 implies that the specific number of boards passed should be the

    count used in calculations.

    hypervols Integer Hyper volumes

    containsvdevs 0 | 1 0 is false, 1 is true

    Host Sub-Section [Required; Must be at least 1 host]host

    type HostType The type of host

    OS: Open Systems

    MF: Mainframe

    drivesize DriveSize Size of Drives in GB

    raid Protection Protection Level

    drivecount Integer Number of drives used for the defined host

    custlogvols Integer Number of customer log volumes

    Mainframe Virtual (MF) Devices Sub-Section [Optional; Supports Many]

    mf_vdevs

    mf_dataprotection Protection Protection Level of Virtual Device

    mf_vdevchange 0..100 Virtual Device Percentage Changemf_savedevunitsize Integer Virtual Device Unit Size in GB

    Open Systems (OS) Virtual Devices Sub-Section [Optional; Supports Many]

    os_vdevs

    os_dataprotection Protection Protection Level of Virtual Device

    os_vdevchange 0..100 Virtual Device Percentage Change

    os_savedevunitsize Integer Virtual Device Unit Size in GB

    Virtual Device Sub-Section [Minimum of 1 for each MF or OS Virtual Devices Section]

    mf_vdev | os_vdev

    numvdevs Integer Number of Virtual Devices

    vdevunitsize Integer Virtual Device Size in GB

    Table 4 - XML Tag Listing of DLL Input

  • 7/31/2019 Cache Calculator API (15 Jan 2004)

    19/22

    Mark Silvestri Page 18 1/15/2004

    4.3.4 Tag Listing (DLL Output)

    Tag Description

    Usage

    Valid Values Description

    Output Section [Required]

    output

    c###gb Integer The specific number of memory boards of the given type where the

    ### is the size of the memory board in GB.

    mincache Integer The total amount of cache required by the system. It is the total of the

    board sizes and counts.

    power Integer The number of power supplies the system would require.

    Error Sub-Section

    Error

    If this is returned, there are no sub-tags. The text surrounded by the

    Error tags is the error message.

    Table 5 - XML Tag Listing of DLL Output

    4.3.5 XML Examples

    4.3.5.1 Minimal Example

    6.0

    DMX3000

    0

    8

    0

    0

    0

    4

    Default

    1

    OS

    146

    MIRRORED

    576

    0

    List 1 - Example XML with Basic 6.5 Syntactical Categories

    4.3.5.2 Expected Output

    2

    2

    96

    6

    List 2- Example Expected Output

  • 7/31/2019 Cache Calculator API (15 Jan 2004)

    20/22

    Mark Silvestri Page 19 1/15/2004

    4.3.5.3 Example of error Output

    Entered num of Cache Boards is 1, the minimum allowed num of Cache Boards is

    4

    List 3- Example Expected Output

    4.3.6 Restrictions

    The Host, Virtual Devices, and Virtual Device tag item sections must be given in the order listed in Table 4.

    White Space

    4.4 Remaining Issues

    4.4.1 Illegal XML Returned in Error XML

    4.4.1.1 Problem Description

    It is possible to get an error message that is illegal XML.

    Example string returned:

    Cache Calculator: Document Parse Error: Code: -1072896749, Line: 2, LPos: 29,

    Reason: Whitespace is not allowed at this location.

    , Source: 6.0 & , fPos: 38

    4.4.1.2 Solution

    Question:?

    4.5 Example Scenarios

    This section will describe how to use the tool by giving explicit examples using the system.

  • 7/31/2019 Cache Calculator API (15 Jan 2004)

    21/22

    Mark Silvestri Page 20 1/15/2004

    5. Power and Cache Calculator - Version 7+

    This chapter describes the exactly what and how the system will work for release 7+. It will include specific

    API calls,

    5.1 Overview

    This code will still support both "one-shot" solutions, however, it will now also support option of building a

    configuration one function at a time.

    Figure 9 - Version 7 DLL Interface

    5.2 Changes from 6.5

    Add Primitive functions that allow for

    Multiple calls to configure

    Multiple calls to return values

    5.3 API

    5.4 Remaining Issues

    5.5 Example Scenarios

    This section will describe how to use the tool by giving explicit examples using the system.

    DLL

    DataCrunch

    DMX3000

    0

    8

    0

    0

    8

    Default

    0

    "

    OP

    146K

    MIRRORED576

    0

    "

    DMX3000

    0

    8

    0

    0

    8

    Default

    0

    "

    OP

    146K

    MIRRORED576

    0

    "

    XML XML

    IN

    PU

    T

    API Function Callfunction LoadData(record struct)

    AddDisks()

    AddBoards()

    AddVolumes()

    etc.

    API API

    API Function Callfunction LoadData(record struct)

    function GetCacheBoards()

    function GetPowerSystems()

    OUTP

    UT

  • 7/31/2019 Cache Calculator API (15 Jan 2004)

    22/22

    6. Known System Issues

    This chapter lists issues that need to be addressed because they impact more than a single piece of the

    system.

    6.1 Severity One Issues

    These are issues that must be addressed prior to release. They are considered catastrophic to the system or

    generate output that could cost EMC money (in sales, replacements, etc.)

    6.1.1

    6.1.1.1 Problem Description

    6.1.1.2 Solution

    6.2 Severity Two Issues

    These are issues that should be addressed prior to release, but will not be catastrophic to a user.

    6.2.1

    6.2.1.1 Problem Description

    6.2.1.2 Solution

    6.3 Severity Three Issues

    These are issues that should be addressed as time permits. These are not critical issues.

    6.3.1

    6.3.1.1 Problem Description

    6.3.1.2 Solution