Skip to content

Instantly share code, notes, and snippets.

@x2c3z4
Last active May 20, 2016 04:29
Show Gist options
  • Save x2c3z4/32730504e245dad299fb to your computer and use it in GitHub Desktop.
Save x2c3z4/32730504e245dad299fb to your computer and use it in GitHub Desktop.
i=klog
build=96
vcpu=8
vmem=16G
size=20G
ldm add-vsw net-dev=net0 primary-vsw0 primary
ldm add-vds primary-vds0 primary
ldm add-vcc port-range=5000-5100 primary-vcc0 primary
ldm remove-vcpu $vcpu primary
ldm remove-memory $vmem primary
zfs create -V $size rpool/ldom-$i
ldm add-domain $i
ldm add-vcpu $vcpu $i
ldm add-memory $vmem $i
#ldm set-mau 1 $i
ldm add-vnet vnet1 primary-vsw0 $i
ldm add-vdsdev /dev/zvol/dsk/rpool/ldom-$i vol-$i@primary-vds0
ldm add-vdisk vol-$i vol-$i@primary-vds0 $i
ldm set-var auto-boot?=true $i
ldm set-var boot-device=iso-$i $i
curl -JOL http://nana.cn.oracle.com/nana/products/Solaris_12/s12.0/$build/sol-12_0-$build-text-sparc.iso
ldm add-vdsdev options=ro ~/sol-12_0-$build-text-sparc.iso iso-$i@primary-vds0
ldm add-vdisk iso-$i iso-$i@primary-vds0 $i
svcadm enable ldoms/vntsd
ldm bind $i
ldm start $i
ldm list-bindings $i
telnet localhost `ldm list | grep $i | awk '{print $4}'`
#ok> devalias
#ok> boot iso
#https://docs.oracle.com/cd/E37707_01/html/E29665/createdefaultservices.html
#http://thegeekdiary.com/how-to-install-and-configure-ldoms-oracle-vm-for-sparc/
#https://community.oracle.com/thread/1950013?start=0&tstart=0
#!/bin/bash
i=klog
ldm stop $i
ldm unbind $i
ldm remove-vdisk iso-$i $i
ldm remove-vdsdev iso-$i@primary-vds0
ldm remove-vdisk vol-$i $i
ldm remove-vdsdev vol-$i@primary-vds0
ldm destroy $i
url=`pwd`/nightly-nd && /opt/onbld/bin/onu -t fengli-`date +%Y%m%d` -v -d $url
tar cvzf `date +%Y%m%d`-nd-sparc.tar.gz nightly-nd/
nip=10.113.194.153/24
ngateway=10.113.194.1
# http://blog.allanglesit.com/2012/05/solaris-11-dns-client-configuration-using-svccfg/
ipadm delete-addr net0/v4
ipadm create-addr -T static -a $nip net0/v4
svccfg -s svc:/network/dns/client setprop config/search=\(cn.oracle.com us.oracle.com oracle.com\)
svccfg -s svc:/network/dns/client setprop config/nameserver=net_address: \(10.182.244.34 10.182.96.20 192.135.82.84\)
svccfg -s name-service/switch setprop config/ipnodes = astring: '("files dns")'
svccfg -s name-service/switch setprop config/host = astring: '("files dns")'
svccfg -s network/dns/client listprop config
svcadm refresh svc:/network/dns/client
svcadm refresh name-service/switch
# route
route -p add default $ngateway
route get default
netstat -nr
# route -p delete 10.10.10.0/24 192.168.1.1
#hostname
hostname=klog
if false;then
svccfg -s svc:/system/identity:node setprop config/nodename = astring: $hostname
svcadm refresh svc:/system/identity:node
svcadm restart identity:node
fi
@x2c3z4
Copy link
Author

x2c3z4 commented Feb 24, 2016

@x2c3z4
Copy link
Author

x2c3z4 commented Mar 24, 2016

url=`pwd`/nightly-nd && /opt/onbld/bin/onu -t fengli-`date +%Y%m%d` -v -d  $url
tar cvzf `date +%Y%m%d`-nd-sparc.tar.gz nightly-nd/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment