25
VMware Studio Introduction Hubert Chan

VMware studio practice in TIM

Embed Size (px)

Citation preview

Page 1: VMware studio practice in TIM

VMware Studio Introduction

Hubert Chan

Page 2: VMware studio practice in TIM

VMware Studio Benefits

• VMware Studio Benefits– Building vApps – Automated the building of Virtual Appliances– Integrate Virtual Appliance Management

Infrastructure– Other Benefit

https://www.vmware.com/products/studio/benefits.html

Page 3: VMware studio practice in TIM

Before VMware Studio Solution

• Creating a Base Image by hand– Manual 3rd party Libraries Management– Manual cleanup and post action– Modification is not version controlled– Recreate base image when add/remove 3rd party

libraries

Page 4: VMware studio practice in TIM

State of Art

• Manual Instruction NOT so reliable• Midnight Daily Build suffers the Build Master• Frequent bug fixing cause build master busy to

generate new OVA

Page 5: VMware studio practice in TIM

Generate OVA by VMware Studio

• VMware Studio integrates– VIX API– vSphere API– CentOS / RHEL• Kickstart (ks.cfg)• Yum repository

Page 6: VMware studio practice in TIM

What you need to do

• Create a VM profile– VM template (CentOS / RedHat / …)– Define VM Hardware Specification• CPU, RAM, NICs• Partition Layout

– Define Installed Applications– Define Pre/Post Install Scripts– Build Related settings

Page 7: VMware studio practice in TIM

VM Profile Template

• Inherit base template

Page 8: VMware studio practice in TIM

Hardware Specification

• CPU / RAM / NICs

Page 9: VMware studio practice in TIM

Hardware Specification

• Disk and Partition

Page 10: VMware studio practice in TIM

Support CentOS repository

• Install RPMs from media (DVD ISO)

Page 11: VMware studio practice in TIM

Install Packages

• Install 3rd party / ISV packages

Page 12: VMware studio practice in TIM

Application Pre/Post Install Scripts

• Customization Scripts

Page 13: VMware studio practice in TIM

Build Related Settings

• ESXi related setting

Page 14: VMware studio practice in TIM

Command Line

• studiocli provides– Query build status– Create a new build– Delete a build

Page 15: VMware studio practice in TIM

Ideally…

• Ideally…– Create a VM profile once– Use studiocli to trigger a build– Copy built OVA through SCP

Page 16: VMware studio practice in TIM

We think we can have

• Advantages– Auto build for OVA– Add/Remove 3rd party libraries without pain– Easy to customize pre/post install scripts– VM Profile can be version controlled

Page 17: VMware studio practice in TIM

Houston, we’ve got a problem.

• Install4j package is not RPM– Use post install script to install install4j package

$ wget -r -np -nH -R "index.html*" http://[VADK.localIP]/install_package/

Page 18: VMware studio practice in TIM

Houston, we’ve got a problem.

• No CentOS 6.2 Template– Rewrite from RHEL 6.1

• Deployment of Install Package/RPMs is slow– Use rsync– http://coolshell.cn/articles/7425.html

Page 19: VMware studio practice in TIM

Houston, we’ve got a problem.

• Provide a way to do manual installation– Hand made python scripts to control flows• Installation• Patch 3rd party configuration• Firewall rules

• studiocli does not work through SSH– Use /opt/vmware/share/build/vabs.pl

Page 20: VMware studio practice in TIM

Houston, we’ve got a problem.

• Modify VM profile XML for rpms/scripts– Use python lxml and glob

• Need a CPAN mirror– Mini CPAN– Hack for CPAN init

Page 21: VMware studio practice in TIM

Houston, we’ve got a problem.

• Detect build automatically from tw-testing– autofs to mount tw-testing– Check MD5 every 5 minutes and store version in a

python pickle– Trigger OVA build

Page 22: VMware studio practice in TIM

Houston, we’ve got a problem.

• Performance– Tuning (especially in memory)– Use SSD to save some time– Can use vmxnet in the future

• Check VM instance whether powered off bug– No good solution now

Page 23: VMware studio practice in TIM

Houston, we’ve got a problem.

• Separate Deployment Configuration– Use WRKDIR for latest package– Only overwrite deployment settings

Page 24: VMware studio practice in TIM
Page 25: VMware studio practice in TIM

Q & A