Giter VIP home page Giter VIP logo

aix-export's Introduction

POWER AIX Export Script

Copyright 2020 Skytap Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Things to know before getting started:

  • The script and pigz need to be made available on the AIX LPAR and should be in the same directory.
    • Note: The gzip libraries are required and are generally available in a default AIX installation.
  • Script output, in the form of an .ova file, will be located in the output directory selected via the prompt. The output location can be local or remote via NFS.
  • The scripts do not perform destructive tasks and will not clean up any files they generate.
  • Only the disk images specified when running export_lpar will generate disk images and these images will include unused space on the disk (do not have a way to flatten the images out at this time).
  • The space required to image an LPAR is double the space of the drives being imaged. This is to accomodate imaging and compression.

There is one script involved:

export_lpar.ksh

Background

This script is intended to produce a compress packaged .ova file of the LPAR. The output of this script is IMG files which are the disk images for the LPAR, one of these IMG files must represent the rootvg. It will also generate an OVF file which is the descriptor of the LPAR. The OVF will be used at time of import by Skytap to create the LPAR to specifications.

How to use this script

  • Ensure a rootvg is available to be copied. It is recommended to use alt_disk_copy command to create an up-to-date version of rootvg that can be used to create the root disk image.
  • Workloads on disks you want to create images of should be quiesced. Optional to further varyoffvg the physical volumes.
  • Within the directory you want your images to be created, run export_lpar.ksh with physical volume names as arguments, starting with your rootvg.
  • The LPAR file, .ova, can be uploaded and imported directly into Skytap via SFTP or Cloud Object Storage.
Import CheatSheet:
disks consumption is quite massive (in part because we dont have an option to compress the disk images yet).
make_ovf assumes a couple things. that the disk images are already created, and it is being run on the system that the disks are on.
what you need to do:
1. create or update alt_disk_copy to get rootvg that is not in use. Example:
# alt_disk_copy -d hdisk1 -B
2. run export_lpar with the disks as arguments. output will be disk images and hostname.ovf Example:
# ./export_lpar.ksh hdisk1 hdisk2 hdisk3
3. upload and import to Skytap import site, flagging the job for Power VM. Account must be Power enabled.

export_lpar.ksh

export_lpar expects to be passed a string of physical volume names (eg, hdisk0, hdisk1...). It will then validate it has access to those disks and use dd to create IMG files for each disk. The IMG files will be created in your present working directory. The first physical volume specified needs to be rootvg, it is strongly recommended that the underlying physical volume for rootvg be an up-to-date copy created from alt_disk_copy. When the image files are created, it will then automatically run make_ovf with the same physical volume arguments.

aix-export's People

Contributors

aka17034 avatar jlaneskytap avatar johnybradshaw avatar mlindahl avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aix-export's Issues

pigz?! really?

Most of the systems do not have pgzip installed as required by the export_lpar.ksh script.

Compressing file: /image/skytap-aix72.ova
./export_lpar.ksh[182]: ./pigz: not found.
mv: 0653-401 Cannot rename /image/skytap-aix72.gz to /image/skytap-aix72.ova:
A file or directory in the path name does not exist.

Export script should check size of exported disks against the actual size

Attempting to export my LPAR reports everything is fine:

autoadmin@my-aix-host:/dest/exportaix$ sudo ./export_lpar.ksh hdisk0 hdisk1 hdisk2 hdisk3

Disks:
Found device hdisk0, 17408 MB
Found device hdisk1, 2048 MB
Found device hdisk2, 3072 MB
Found device hdisk3, 4096 MB

Disk images will be created uncompressed in local directory.
Create these image(s)? (Yes/No)
Yes

Creating disk hdisk0.img
Creating disk hdisk1.img
Creating disk hdisk2.img
Creating disk hdisk3.img
Disks images created

Creating OVF file: my-aix-host.ovf
OVF Completed Successfully

However, from the disk files it is clear that the export failed:

autoadmin@my-aix-host:/dest/exportaix$ ll

total 8388656
drwxr-xr-x 2 autoadmi staff 256 Mar 08 11:40 ./
drwxr-xr-x 4 autoadmi staff 256 Mar 07 17:53 ../
-rwxr-xr-x 1 autoadmi staff 2226 Mar 07 17:49 export_lpar.ksh*
-rw-r--r-- 1 root system 1073741312 Mar 08 11:36 hdisk0.img
-rw-r--r-- 1 root system 1073741312 Mar 08 11:37 hdisk1.img
-rw-r--r-- 1 root system 1073741312 Mar 08 11:38 hdisk2.img
-rw-r--r-- 1 root system 1073741312 Mar 08 11:40 hdisk3.img
-rwxr-xr-x 1 autoadmi staff 7624 Mar 07 17:50 make_ovf.ksh*
-rw-r--r-- 1 root system 5206 Mar 08 11:40 my-aix-host.ovf

Expect:
The script should not blindly eat any errors while reporting everything was successful. A rough comparison of the physical disk size compared to the created file would have quickly indicated a failure.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.