Here's a script.....

#!/usr/bin/sh
# Disable Logical Domains and restore machine to factory default
# configuration.
#

LDMCMD=/opt/SUNWldm/bin/ldm

PLATFORM=`/usr/bin/uname -i | /usr/bin/awk -F, '{print $2}'`

if [ "${PLATFORM}" = "Sun-Fire-T200" ]
then
NICDRIVER=e1000g

elif [ "${PLATFORM}" = "T5140" ]
then
NICDRIVER=nxge

elif [ "${PLATFORM}" = "SPARC-Enterprise-T5220" ]
then
NICDRIVER=e1000g

elif [ "${PLATFORM}" = "Sun-Blade-T6320" ]
then
NICDRIVER=e1000g

elif [ "${PLATFORM}" = "T5240" ]
then
NICDRIVER=nxge
else
echo "Error"
echo "Error"
echo "Error"
echo " "
echo "Please add the platform $PLATFORM and NIC adapter type to this
script!"
echo " "
echo "add $PLATFORM"
echo "add $PLATFORM"
echo "add $PLATFORM"
echo " "
echo "good-bye"
echo " "
exit
fi

#----------------------------------------------------------------------
# Prompt to confirm disabling LDoms.
#----------------------------------------------------------------------
CONFIRM=`/usr/bin/ckyorn \
-p "Do you really want to disable LDoms and restore the machine to the
factory default configuration?:"`

if [ "${CONFIRM}" = "n" ]
then
echo "Exiting. No changes made."
exit
fi

# Rename the /etc/hostname.vsw0 file to /etc/hostname.${NICDRIVER}0 to
restore
# the physical network interface that was changed by the
# "ldomcreatecontroldomain.sh" script.

if [ -f /etc/hostname.vsw0 ]
then
/usr/bin/mv /etc/hostname.vsw0 /etc/hostname.${NICDRIVER}0
fi

# Stop all guest domains.
${LDMCMD} stop-domain -a

# Remove all guest domain configurations, unbind their resources and remove
# the domains.

${LDMCMD} list-config | /usr/bin/awk '{print $1}' |\
while read LDOMNAME
do
if [ "${LDOMNAME}" != "factory-default" -a \
"${LDOMNAME}" != "primary-configured" -a \
"${LDOMNAME}" != "primary.conf1" ]
then
${LDMCMD} remove-config ${LDOMNAME}
${LDMCMD} unbind-domain ${LDOMNAME}
${LDMCMD} remove-domain ${LDOMNAME}
fi
done

# Disable the LDoms Virtual Network Terminal Server daemon.
/usr/sbin/svcadm disable vntsd

# Restore the factory default configuration.
${LDMCMD} set-config factory-default

# Remove the primary domain configuration set up by the
# "ldomcreatecontroldomain.sh" script.
${LDMCMD} remove-config primary-configured

cat <<EOD

You must now shutdown the control domain and power cycle the
machine so that the factory-default configuration is reloaded.
shutdown -i0 -g0 -y
Use the system controller commands to power cycle the machine.
either ALOM:
sc> poweroff
sc> poweron
or ILOM:
-> stop /SYS
-> start /SYS

After the system boots, you can optionally disable the
Logical Domains Manager with:
svcadm disable ldmd

Furthermore, you can optionally remove the Logical Domains
Manager with:
pkgrm SUNWldm

EOD

exit


On Wed, Jul 28, 2010 at 8:17 AM, Steve Goldthorpe <[email protected]>wrote:

> Personally i'd reset back to factory defaults IIRC:
>
> stop and unbind each ldom
> # ldm set-config factory-default
> and reboot
>
> or from ALOM:
>
> sc> bootmode config="factory-default"
>
> sc> powercycle -y
>
> -Steve
>
> --- On Wed, 28/7/10, [email protected] <
> [email protected]> wrote:
>
> > From: [email protected] <[email protected]>
> > Subject: Re: [ldoms-discuss] LDOM Removal
> > To: [email protected]
> > Cc: [email protected]
> > Date: Wednesday, 28 July, 2010, 12:01
> > Hi Smith,
> >
> > Thanks will do the same and update you..If any issue then
> > will again
> > question will be for U.Thanks
> >
> > Cheers!!
> > Madhulika Kherwa
> >
> > -----Original Message-----
> > From: [email protected]
> > [mailto:[email protected]]
> >
> > Sent: Wednesday, July 28, 2010 4:25 PM
> > To: Madhulika Kherwa (WI01 - Enterprise Services)
> > Cc: [email protected]
> > Subject: Re: [ldoms-discuss] LDOM Removal
> >
> > On 28/07/2010 11:52, [email protected]
> > wrote:
> > > Hi Smith,
> > >
> > > Thanks for prompt reply !
> > >
> > > I tried
> > >
> > > r...@server_ldom # ldm list
> > > NAME
> >    STATE
> > FLAGS   CONS    VCPU
> > MEMORY   UTIL  UPTIME
> > > primary
> > active   -n-cv   SP
> >     4     4G
> >    0.8%  37d 21m
> > > dev01-lgdm01
> >    active   -n---   5000
> >   8     8G
> >    0.1%  37d 21m
> > > dev01-lgdm02
> >    active   -n---   5001
> >   4     4G
> >    0.2%  37d 21m
> > > dev01-lgdm03
> >    active   -n---   5002
> >   4     4G
> >    0.2%  37d 21m
> > > dev01-lgdm04
> >    active   -n---   5003
> >   4     4G
> >    0.3%  37d 21m
> > > dev01-lgdm05
> >    active   -n---   5004
> >   4     4G
> >    7.3%  37d 21m
> > > dev01-lgdm06
> >    active   -n---   5005
> >   4     3G
> >    0.2%  37d 21m
> > > r...@server_ldom # ldm stop dev01-lgdm05
> > > LDom dev01-lgdm05 stopped
> > > r...@server_ldom # ldm unbind-domain dev01-lgdm06
> > > r...@server_ldom # ldm list
> > > NAME
> >    STATE
> > FLAGS   CONS    VCPU
> > MEMORY   UTIL  UPTIME
> > > primary
> > active   -n-cv   SP
> >     4     4G
> >    0.9%  37d 3h
> > > 35m
> > > dev01-lgdm01
> >    active   -n---   5000
> >   8     8G
> >    0.1%  37d 3h
> > > 35m
> > > dev01-lgdm02
> >    active   -n---   5001
> >   4     4G
> >    0.2%  37d 3h
> > > 35m
> > > dev01-lgdm03
> >    active   -n---   5002
> >   4     4G
> >    0.2%  37d 3h
> > > 35m
> > > dev01-lgdm04
> >    active   -n---   5003
> >   4     4G
> >    0.3%  37d 3h
> > > 35m
> > > dev01-lgdm05
> >    active   -n---   5004
> >   4     4G
> >    7.6%  37d 3h
> > > 35m
> > > dev01-lgdm06     inactive
> > -----           4
> >    3G
> > > r...@server_ldom # ldm remove-domain dev01-lgdm06
> > > r...@server_ldom # ldm list
> > > NAME
> >    STATE
> > FLAGS   CONS    VCPU
> > MEMORY   UTIL  UPTIME
> > > primary
> > active   -n-cv   SP
> >     4     4G
> >    0.9%  37d 3h
> > > 35m
> > > dev01-lgdm01
> >    active   -n---   5000
> >   8     8G
> >    0.1%  37d 3h
> > > 35m
> > > dev01-lgdm02
> >    active   -n---   5001
> >   4     4G
> >    0.2%  37d 3h
> > > 35m
> > > dev01-lgdm03
> >    active   -n---   5002
> >   4     4G
> >    0.2%  37d 3h
> > > 35m
> > > dev01-lgdm04
> >    active   -n---   5003
> >   4     4G
> >    0.3%  37d 3h
> > > 35m
> > > dev01-lgdm05
> >    active   -n---   5004
> >   4     4G
> >    7.6%  37d 3h
> > > 35m
> > >
> > >
> > > I am able to delete the domains.Now issue is that if I
> > delete all the
> > > Domains thn the assigned Memory/CPU/Disk all things
> > will go back to
> > the
> > > Main domain or not.If it ll go to Primary domain thn
> > how to delete the
> > > Primary domain and assign the resources to the
> > server.
> > >
> > > Cheers!!
> > > > Madhulika Kherwa
> > >
> > Hi
> >
> > Do a ldm set-vcpu <all cpus> primary
> > ldm set-vmem <all mem> primary
> >
> > reboot
> > this will put all resources in domain primary
> >
> > do a package remove of the SUNWldm package ( and SUNWldmp2v
> > )
> >
> > and reboot again
> >
> > All domain information will have gone
> >
> > T
> >
> >
> > > -----Original Message-----
> > > From: [email protected]
> > > [mailto:[email protected]]
> > On Behalf Of
> > > [email protected]
> > > Sent: Wednesday, July 28, 2010 4:15 PM
> > > To: [email protected]
> > > Subject: Re: [ldoms-discuss] LDOM Removal
> > >
> > > Hi
> > >
> > > Have you tried
> > >
> > > ldm stop -f dev01-lgdm06
> > >
> > > that should force the domain to stop.
> > >
> > > Failing that do
> > >
> > > ldm set-var auto-boot\?=false dev01-lgdm06
> > >
> > > ldm add-config<newconfig name>
> > > (just to make sure you have kept settings)
> > >
> > > powercycle the box
> > >
> > > on rebooting the control domain dev01-lgdm06 if
> > started will be at the
> > > ok prompt and so a normal ldm stop will stop it.
> > >
> > > T
> > >
> > >
> > > On 28/07/2010 10:43, [email protected]
> > wrote:
> > >> Hi All,
> > >>
> > >> We have T2000 Server and on the same we need to
> > remove all the
> > logical
> > >> domains and need to re-install OS .Kindly suggest
> > how to remove the
> > >> Primary and other 6 guest domains.
> > >>
> > >> Also after LDOM removal we want to get all the
> > hardware back to the
> > >> physical server for the same if require additional
> > to do something
> > > then
> > >> please suggest.
> > >>
> > >> I done with command ldm remove-domain dev01-lgdm06
> > but it is showing
> > >> problem as "LDom dev01-lgdm06 cannot be deleted
> > because it is not
> > >> inactive".Also ldm list o/p ="dev01-lgdm06 active
> > -n--- 5005 4 3G
> > 0.3%
> > >> 4m " , I m unable to make the state as inactive in
> > the domain. Kindly
> > >> suggest some inputs. Thanks in advance!
> > >>
> > >> *Madhulika Kherwa *
> > >>
> > >> * Please do not print this email unless it is
> > absolutely necessary. *
> > >>
> > >> The information contained in this electronic
> > message and any
> > > attachments
> > >> to this message are intended for the exclusive use
> > of the
> > addressee(s)
> > >> and may contain proprietary, confidential or
> > privileged information.
> > > If
> > >> you are not the intended recipient, you should not
> > disseminate,
> > >> distribute or copy this e-mail. Please notify the
> > sender immediately
> > > and
> > >> destroy all copies of this message and any
> > attachments.
> > >>
> > >> WARNING: Computer viruses can be transmitted via
> > email. The recipient
> > >> should check this email and any attachments for
> > the presence of
> > > viruses.
> > >> The company accepts no liability for any damage
> > caused by any virus
> > >> transmitted by this email.
> > >>
> > >> www.wipro.com
> > >>
> > >>
> > >>
> > >> _______________________________________________
> > >> ldoms-discuss mailing list
> > >> [email protected]
> > >> http://mail.opensolaris.org/mailman/listinfo/ldoms-discuss
> > >
> > >
> >
> >
> > --
> > Terry Smith
> > Principal Sales Consultant
> > Mobile: +44 7802 212151
> > Oracle Server Specialist
> > EMEA United Kingdom
> >
> > ORACLE Corporation UK Ltd is a company incorporated in
> > England & Wales
> > Company Reg. No. 1782505
> > Reg. office: Oracle Parkway, Thames Valley Park, Reading
> > RG6 1RA
> >
> >
> > Please do not print this email unless it is absolutely
> > necessary.
> >
> > The information contained in this electronic message and
> > any attachments to this message are intended for the
> > exclusive use of the addressee(s) and may contain
> > proprietary, confidential or privileged information. If you
> > are not the intended recipient, you should not disseminate,
> > distribute or copy this e-mail. Please notify the sender
> > immediately and destroy all copies of this message and any
> > attachments.
> >
> > WARNING: Computer viruses can be transmitted via email. The
> > recipient should check this email and any attachments for
> > the presence of viruses. The company accepts no liability
> > for any damage caused by any virus transmitted by this
> > email.
> >
> > www.wipro.com
> > _______________________________________________
> > ldoms-discuss mailing list
> > [email protected]
> > http://mail.opensolaris.org/mailman/listinfo/ldoms-discuss
> >
> _______________________________________________
> ldoms-discuss mailing list
> [email protected]
> http://mail.opensolaris.org/mailman/listinfo/ldoms-discuss
>
_______________________________________________
ldoms-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/ldoms-discuss

Reply via email to