[one-users] SCRIPT: for windows guest OS user :)

mario wu iamokcn at gmail.com
Wed Jun 6 02:13:12 PDT 2012


hi,all
     i writed a trivial script for windows guest OS user, for automatic
setting ip address,gateway address,dns server, and change the hostname:) .
in the attachment.

the vm template sample like this:

CONTEXT = [
>   HOSTNAME   = "$NAME",
>   IP_PUBLIC = "$NIC[IP]",
>   NET_MASK = "$NETWORK[NETWORK_MASK,NETWORK_ID=27]",
>         DNS_ADDR="$NETWORK[DNS_ADDR,NETWORK_ID=27]",
>         GATEWAY_ADDR="$NETWORK[GATEWAY_ADDR,NETWORK_ID=27]"
> ]



and the vnet template must have this attribute:


DNS_ADDR="192.168.180.102"
> GATEWAY_ADDR="192.168.173.254"
> NETWORK_MASK="255.255.255.0"




just put the vbscript in the schedule task and set run as computer start.

run as:

> cscript.exe \some\path\for\set-network.vbs


 the context.sh like this:

# Context variables generated by OpenNebula
> DNS_ADDR="192.168.180.102"
> GATEWAY_ADDR="192.168.173.254"
> HOSTNAME="test-win2003"
> IP_PUBLIC="192.168.173.100"
> NET_MASK="255.255.255.0"
> TARGET="hdb"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20120606/ca2cbc97/attachment-0002.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: set-network.rar
Type: application/rar
Size: 1061 bytes
Desc: not available
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20120606/ca2cbc97/attachment-0002.rar>


More information about the Users mailing list