Hi Guys,<br><br>I am writing to you for some question on creating my own windows image for openstack.<br>I
have built my own openstack, and ubuntu works well on it. But when I
try to run windows instance, it failed to get IP address and host
information. I found a blog via Google search. But the page described
about windows 2008. I am sure it's similar to windows 2003.<br>Here is the URL: <a href="http://blogs.poolsidemenace.com/2011/06/16/porting-windows-to-openstack/" target="_blank">http://blogs.poolsidemenace.com/2011/06/16/porting-windows-to-openstack/</a><br>
<br>Here are what I did:<br>1. kvm-img create -f raw windows.img 10G<br>2. kvm -m 2048 -cdrom *** -drive file=windows.img -fda virtdrivefile ***<br>3. Install a windows 2003 to that image.<br>4. Run windows update and shutdown the virtual system.<br>
5. Use euca commands upload and register the image.<br>6. Run euca-run-instance<br><br>OK, below are the problems:<br>1. First time the windows won't start, no log in consloe.log(Full path will be /var/lib/nova/instance/<i><b>instance-id</b></i>/console.log by default)<br>
2. If I run euca-reboot-instance follow the instance id, windows start. But no IP assigned. <br>3. If I do a reboot or power recycle on the physical machine, all Linux instance restored to running status, but windows won't.<br>
<br>I tried to solve those problems myself. And found the blog. <br>I
also read four microsoft links in the post. But I have no idea about
how to design my solution. <br>So what I need to do are:<br>1. design a unattend.xml<br>
I found if no IP address give to windows, he can get a 169.254.x.y, but
couldn't communicate with 169.254.169.254. If I assign an IP to the
instance, 169.254.169.254 is reachable.<br> Is that OK to write an IP on unattend.xml so when the instance first start he can get information from ec2 or nova api.<br>2. How does RunSynchronousCommand work?<br>Below are on the blog. With the MS technet link. But I still do not know how to use runsyncronouscommand. <br>
<i>
The Windows base image that is illustrated here utilizes a custom
unattend.xml file for sysprep that contains a RunSynchronousCommand. The
RunSynchronousCommand calls a custom executable that calls the
OpenStack metadata API at <a href="http://169.254.169.254/latest/user-data/" target="_blank">http://169.254.169.254/latest/user-data/</a> to
pull user specified data (e.g., Administrator password) for
configuration data. The custom executable than takes the configuration
data and slams it into the cached copy of the unattend.xml file for
sysprep to use to customize the Windows OS.</i><br><br>Finally, I think I should give you my nova configuration file here:<br>
<br>
<div style="margin-left:40px"><span style="font-family:courier new,monospace">--dhcpbridge_flagfile=/etc/nova/nova.conf</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">--dhcpbridge=/usr/bin/nova-dhcpbridge</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">--logdir=/var/log/nova</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">--state_path=/data/nova</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">--lock_path=/var/lock/nova</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">--verbose</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">--s3_host=100.100.0.254</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">--rabbit_host=100.100.0.254</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">--cc_host=100.100.0.254</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">--ec2_url=<a href="http://100.100.0.254:8773/services/Cloud" target="_blank">http://100.100.0.254:8773/services/Cloud</a></span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">--fixed_range=<a href="http://192.168.0.0/16" target="_blank">192.168.0.0/16</a></span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">--network_size=8</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">--network_manager=nova.network.manager.FlatDHCPManager</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">--FAKE_subdomain=ec2</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">--routing_source_ip=100.100.0.254</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">--sql_connection=mysql://<a href="http://nova:nova@100.100.0.254/nova" target="_blank">nova:nova@100.100.0.254/nova</a></span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">--glance_host=100.100.0.254</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">--image_service=nova.image.glance.GlanceImageService</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">--start_guests_on_host_boot=true</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">--scheduler_driver=nova.scheduler.simple.SimpleScheduler</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">--use_cow_images=false</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">--my_ip=100.100.0.254</span><br>
</div><i><b>
<br>Note: If you use my nova.conf and found it won't work, you can try to change the network_manager to FlatManager and restart all nova services.</b></i><br>
<br>
Thanks your time reading my problem.<br>
<br clear="all">Zhang Qi<br>