This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

(DP) Support Tip: Importing media from a StoreOnce store.

First of all, it is important to understand that the name of a slot of a Catalyst device in Data Protector is equal to the name of the corresponding item on the store. Typically it looks like this: 3ef5dcb2_5645d8f4_11d4_0001. Please note the difference with the “Medium ID” which is looking similar but which is using colons rather than underscores, e.g. 3ef5dcb2:5645d8f5:11d4:0002. Also note the numbers for the slot ID and the Medium ID are looking similar, but are typically slightly different.

Now, when a medium is missing in the IDB, but the related item is still available on the store, it is possible to import the medium (either through the GUI or CLI). However, a slot is needed first. In some situations, the (empty) slot may still be there. The first slot in this picture is an example:

 

 

This slot could be imported through GUI or CLI.

If the slot is, for whatever reason, not available then it needs to be created before the import can be executed. Use the following command for the slot creation:

omnimm -add_slots <DP device name> <SlotID>

“DP device name” is the StoreOnce device in DP or the library name. “SlotID” is the item name on the store. The following command can be used to list the items on the store:

omnib2dinfo -list_objects -b2ddevice <DP device name>

Parents
  • 0

    Instead of manually adding slots, why not ask the catalyst store for its objects and create a slot for each and every objcets found. When I had to reimport many, I did it like this:

    DP_DEVICE=somedevice; /opt/omni/bin/omnimm -add_slots "${DP_DEVICE}" $(/opt/omni/bin/omnib2dinfo -list_objects -b2ddevice="${DP_DEVICE}" </dev/null | awk '!/^Object Key/ {print $1}') 2>&1 | grep -v ^Duplicate

     

    If you want to do this for all your devices:

    /opt/omni/bin/omnidownload -list_libraries  | awk '!/^($|Library name|=====|Together : )/ {print $1}' | while read -r DP_DEVICE; do echo "Handling device ${DP_DEVICE}"; /opt/omni/bin/omnimm -add_slots "${DP_DEVICE}" $(/opt/omni/bin/omnib2dinfo -list_objects -b2ddevice="${DP_DEVICE}" </dev/null | awk '!/^Object Key/ {print $1}') 2>&1 | grep -v ^Duplicate; done

     

    If you like bash scripting, you can even avoid trying to add duplicates. Example:

    OBJECTS_ONLY_IN_STORE=($(comm -1 -3 <(/opt/omni/bin/omnidownload -library "${DP_DEVICE}" | sed -r -n -e 's/^[[:space:]] "([[:xdigit:]]{8}_[[:xdigit:]]{8}_[[:xdigit:]]{4}_[[:xdigit:]]{4})"$/\1/p' | sort) <(/opt/omni/bin/omnib2dinfo -list_objects -b2ddevice="${DP_DEVICE}" </dev/null | awk '!/^Object Key/ {print $1}' | sort)));
    if [ "${#OBJECTS_ONLY_IN_STORE[@]}" -gt 0 ]; then /opt/omni/bin/omnimm -add_slots "${DP_DEVICE}" "${OBJECTS_ONLY_IN_STORE[@]}"; fi

     

     

    And if you want to import as well, we can go full monty:

    /opt/omni/bin/omnidownload -list_libraries  | awk '!/^($|Library name|=====|Together : )/ {print $1}' |
    while read -r DP_DEVICE
    do
      echo "[${DP_DEVICE}] Handling device '${DP_DEVICE}'."

      OBJECTS_ONLY_IN_STORE=($(comm -1 -3 \
        --\
        <(/opt/omni/bin/omnidownload -library "${DP_DEVICE}" | sed -r -n -e 's/^[[:space:]] "([[:xdigit:]]{8}_[[:xdigit:]]{8}_[[:xdigit:]]{4}_[[:xdigit:]]{4})"$/\1/p' | sort)\
        <(/opt/omni/bin/omnib2dinfo -list_objects -b2ddevice="${DP_DEVICE}" </dev/null | awk '!/^Object Key/ {print $1}' | sort)
      ))
      echo "[${DP_DEVICE}] Found ${#OBJECTS_ONLY_IN_STORE[@]} object(s) in the StoreOnce that are not in Data Protector."

      if [ "${#OBJECTS_ONLY_IN_STORE[@]}" -le 0 ]
      then
        echo "[${DP_DEVICE}] No objects, so nothing to do."
        continue
      fi

      echo "Adding slots to Data Protector."
      /opt/omni/bin/omnimm -add_slots "${DP_DEVICE}" "${OBJECTS_ONLY_IN_STORE[@]}"

      GATEWAY="$(/opt/omni/bin/omnidownload -list_devices -detail | grep -B 10 '^LIBRARY "${DP_DEVICE}"' -m 1 | sed -r -n -e 's/^NAME[[:space:]]*"([^"] )"$/\1/p')"
      N=0
      WAITEVERY=10
      echo "[${DP_DEVICE}] Importing objects with batch size ${WAITEVERY}."
      for OBJECT in "${OBJECTS_ONLY_IN_STORE[@]}"
      do
        echo "[${DP_DEVICE}] Importing object '${OBJECT}'."
        /opt/omni/bin/omnimm -import "${GATEWAY}" -slot "${OBJECT}" &
        (( N % WAITEVERY == 0)) && wait
      done
    done

Reply
  • 0

    Instead of manually adding slots, why not ask the catalyst store for its objects and create a slot for each and every objcets found. When I had to reimport many, I did it like this:

    DP_DEVICE=somedevice; /opt/omni/bin/omnimm -add_slots "${DP_DEVICE}" $(/opt/omni/bin/omnib2dinfo -list_objects -b2ddevice="${DP_DEVICE}" </dev/null | awk '!/^Object Key/ {print $1}') 2>&1 | grep -v ^Duplicate

     

    If you want to do this for all your devices:

    /opt/omni/bin/omnidownload -list_libraries  | awk '!/^($|Library name|=====|Together : )/ {print $1}' | while read -r DP_DEVICE; do echo "Handling device ${DP_DEVICE}"; /opt/omni/bin/omnimm -add_slots "${DP_DEVICE}" $(/opt/omni/bin/omnib2dinfo -list_objects -b2ddevice="${DP_DEVICE}" </dev/null | awk '!/^Object Key/ {print $1}') 2>&1 | grep -v ^Duplicate; done

     

    If you like bash scripting, you can even avoid trying to add duplicates. Example:

    OBJECTS_ONLY_IN_STORE=($(comm -1 -3 <(/opt/omni/bin/omnidownload -library "${DP_DEVICE}" | sed -r -n -e 's/^[[:space:]] "([[:xdigit:]]{8}_[[:xdigit:]]{8}_[[:xdigit:]]{4}_[[:xdigit:]]{4})"$/\1/p' | sort) <(/opt/omni/bin/omnib2dinfo -list_objects -b2ddevice="${DP_DEVICE}" </dev/null | awk '!/^Object Key/ {print $1}' | sort)));
    if [ "${#OBJECTS_ONLY_IN_STORE[@]}" -gt 0 ]; then /opt/omni/bin/omnimm -add_slots "${DP_DEVICE}" "${OBJECTS_ONLY_IN_STORE[@]}"; fi

     

     

    And if you want to import as well, we can go full monty:

    /opt/omni/bin/omnidownload -list_libraries  | awk '!/^($|Library name|=====|Together : )/ {print $1}' |
    while read -r DP_DEVICE
    do
      echo "[${DP_DEVICE}] Handling device '${DP_DEVICE}'."

      OBJECTS_ONLY_IN_STORE=($(comm -1 -3 \
        --\
        <(/opt/omni/bin/omnidownload -library "${DP_DEVICE}" | sed -r -n -e 's/^[[:space:]] "([[:xdigit:]]{8}_[[:xdigit:]]{8}_[[:xdigit:]]{4}_[[:xdigit:]]{4})"$/\1/p' | sort)\
        <(/opt/omni/bin/omnib2dinfo -list_objects -b2ddevice="${DP_DEVICE}" </dev/null | awk '!/^Object Key/ {print $1}' | sort)
      ))
      echo "[${DP_DEVICE}] Found ${#OBJECTS_ONLY_IN_STORE[@]} object(s) in the StoreOnce that are not in Data Protector."

      if [ "${#OBJECTS_ONLY_IN_STORE[@]}" -le 0 ]
      then
        echo "[${DP_DEVICE}] No objects, so nothing to do."
        continue
      fi

      echo "Adding slots to Data Protector."
      /opt/omni/bin/omnimm -add_slots "${DP_DEVICE}" "${OBJECTS_ONLY_IN_STORE[@]}"

      GATEWAY="$(/opt/omni/bin/omnidownload -list_devices -detail | grep -B 10 '^LIBRARY "${DP_DEVICE}"' -m 1 | sed -r -n -e 's/^NAME[[:space:]]*"([^"] )"$/\1/p')"
      N=0
      WAITEVERY=10
      echo "[${DP_DEVICE}] Importing objects with batch size ${WAITEVERY}."
      for OBJECT in "${OBJECTS_ONLY_IN_STORE[@]}"
      do
        echo "[${DP_DEVICE}] Importing object '${OBJECT}'."
        /opt/omni/bin/omnimm -import "${GATEWAY}" -slot "${OBJECT}" &
        (( N % WAITEVERY == 0)) && wait
      done
    done

Children
No Data