Quantcast
Channel: Gluster Community Website » shanks
Viewing all articles
Browse latest Browse all 10

Launching a Windows instance in Openstack Grizzly stored on GlusterFS volume and attaching Cinder volume.

$
0
0
This blog is about how to launch Windows instance and attach cinder volume to it. For howto integrate Openstack with GlusterFS, refer http://gsr-linux.blogspot.in/2013/07/glusterfs-integration-with-openstack.html


My setup:
                 +--------------+
                 |            +-|-----------------+
                 |      D     | |                 |
                 |      I     | | GlusterFS Node 1|
                 |      S     | |                 |
                 |      T     +-|-----------------+
       +---------|-+    R     +-|-----------------+
       |         | |    I     | |                 |
       |---------|-|    B     | | GlusterFS Node 2|
       |         | |    U     | |                 |
       |         | |    T     +-|-----------------+
       |openstack| |    E     +-|-----------------+
       |         | |          | |                 |
       |grizlly  | |    R     | | GlusterFS Node 3|
       |         | |    E     | |                 |
       |         | |    P     +-|-----------------+
       |         | |    L     +-|-----------------+
       +---------|-+    I     | |                 |
                 |      C     | |                 |
                 |      A     | | GlusterFS Node 4|
                 |      T     | |                 |
                 |      E     +-|-----------------+
                 |              |
                 +--------------+



GlusterFS nodes exporting distribute replicate volume to store glance images and cinder volume for Openstack Grizzly

GlusterFS volume information:
# gluster vol info cinder-vol
Volume Name: cinder-vol
Type: Distributed-Replicate
Volume ID: 2f4edaef-678b-492a-b972-bd95c1c490a3
Status: Created
Number of Bricks: 2 x 2 = 4
Transport-type: tcp
Bricks:
Brick1: xx.yy.zz.183:/rhs/brick1/cinder-vol
Brick2: xx.yy.zz.223:/rhs/brick1/cinder-vol
Brick3: xx.yy.zz.183:/rhs/brick2/cinder-vol
Brick4: xx.yy.zz.223:/rhs/brick2/cinder-vol
Options Reconfigured:
storage.owner-gid: 165
storage.owner-uid: 165
network.remote-dio: enable
cluster.eager-lock: enable
performance.stat-prefetch: off
performance.io-cache: off
performance.read-ahead: off
performance.quick-read: off
[root@dhcpzz-183 ~]#


# gluster vol info glance-vol                          

Volume Name: glance-vol
Type: Distributed-Replicate
Volume ID: eedd5254-e0ca-4173-98eb-45eaef738010
Status: Started
Number of Bricks: 2 x 2 = 4
Transport-type: tcp
Bricks:
Brick1: xx.yy.zz.183:/rhs/brick3/glance-vol
Brick2: xx.yy.zz.223:/rhs/brick3/glance-vol
Brick3: xx.yy.zz.183:/rhs/brick4/glance-vol
Brick4: xx.yy.zz.223:/rhs/brick4/glance-vol
Options Reconfigured:
storage.owner-gid: 161
storage.owner-uid: 161
network.remote-dio: enable
cluster.eager-lock: enable
performance.stat-prefetch: off
performance.io-cache: off
performance.read-ahead: off
performance.quick-read: off


Downloading and launching instance

For this experiment I used Windows Server 2012 image listed at http://openstack.redhat.com/Image_resources

After downloading the qcow2 image, I upload it to the glance store which is basically a GlusterFS mount:

~(keystone_admin)]# glance image-create --name="Windows2012" --is-public=true --container-format=bare --disk-format=qcow2 < windows_server_2012_standard_eval_kvm_20130510.qcow2
+------------------+--------------------------------------+
| Property         | Value                                |
+------------------+--------------------------------------+
| checksum         | 801d232ea89f74810284c88b1512a32a     |
| container_format | bare                                 |
| created_at       | 2013-08-13T00:07:38                  |
| deleted          | False                                |
| deleted_at       | None                                 |
| disk_format      | qcow2                                |
| id               | cc1170ea-fdc4-4c35-9a29-4bee70d9fa99 |
| is_public        | True                                 |
| min_disk         | 0                                    |
| min_ram          | 0                                    |
| name             | Windows2012                          |
| owner            | ac0bd9733a08420ab6830223a8e8252b     |
| protected        | False                                |
| size             | 16337731584                          |
| status           | active                               |
| updated_at       | 2013-08-13T00:19:50                  |
+------------------+--------------------------------------+


Let's launch this instance.
 ~(keystone_admin)]# nova boot --flavor 3 --image cc1170ea-fdc4-4c35-9a29-4bee70d9fa99 "Windows Server 2012 instance2"
+-------------------------------------+--------------------------------------+
| Property                            | Value                                |
+-------------------------------------+--------------------------------------+
| status                              | BUILD                                |
| updated                             | 2013-08-13T03:28:02Z                 |
| OS-EXT-STS:task_state               | scheduling                           |
| OS-EXT-SRV-ATTR:host                | None                                 |
| key_name                            | None                                 |
| image                               | Windows2012                          |
| hostId                              |                                      |
| OS-EXT-STS:vm_state                 | building                             |
| OS-EXT-SRV-ATTR:instance_name       | instance-0000000b                    |
| OS-EXT-SRV-ATTR:hypervisor_hostname | None                                 |
| flavor                              | m1.medium                            |
| id                                  | 330dc6fb-92fa-4d17-9a6f-56891da8fef5 |
| security_groups                     | [{u'name': u'default'}]              |
| user_id                             | 00a3bbfa022f4a0abba711a619b88bee     |
| name                                | Windows Server 2012 instance2        |
| adminPass                           | sVePJ9jY6ZBA                         |
| tenant_id                           | ac0bd9733a08420ab6830223a8e8252b     |
| created                             | 2013-08-13T03:28:02Z                 |
| OS-DCF:diskConfig                   | MANUAL                               |
| metadata                            | {}                                   |
| accessIPv4                          |                                      |
| accessIPv6                          |                                      |
| progress                            | 0                                    |
| OS-EXT-STS:power_state              | 0                                    |
| OS-EXT-AZ:availability_zone         | nova                                 |
| config_drive                        |                                      |
+-------------------------------------+--------------------------------------+


Once the "status" is "active", access the console to change the password of the "Administrator" user from the Horizon dashboard.


Creating and attaching cinder volume

Create a cinder volume that should be attached to this Windows instance.

~(keystone_admin)]# cinder create --display-name shanks-windows-vol 5
+---------------------+--------------------------------------+
|       Property      |                Value                 |
+---------------------+--------------------------------------+
|     attachments     |                  []                  |
|  availability_zone  |                 nova                 |
|       bootable      |                false                 |
|      created_at     |      2013-08-13T03:51:15.285543      |
| display_description |                 None                 |
|     display_name    |          shanks-windows-vol          |
|          id         | 9bea8bce-19ff-4a97-81d0-b7619e3d0ca3 |
|       metadata      |                  {}                  |
|         size        |                  5                   |
|     snapshot_id     |                 None                 |
|     source_volid    |                 None                 |
|        status       |               creating               |
|     volume_type     |                 None                 |
+---------------------+--------------------------------------+


Attach Openstack cinder volume to Windows instance

 ~(keystone_admin)]# nova volume-attach 330dc6fb-92fa-4d17-9a6f-56891da8fef5 9bea8bce-19ff-4a97-81d0-b7619e3d0ca3 auto
+----------+--------------------------------------+
| Property | Value                                |
+----------+--------------------------------------+
| device   | /dev/vdb                             |
| serverId | 330dc6fb-92fa-4d17-9a6f-56891da8fef5 |
| id       | 9bea8bce-19ff-4a97-81d0-b7619e3d0ca3 |
| volumeId | 9bea8bce-19ff-4a97-81d0-b7619e3d0ca3 |
+----------+--------------------------------------+

Launch "Computer Management" in the Windows instance and you should see unallocated "Disk 1" which is also offline because of policy set by administrator.



Launch command prompt in Windows and execute "diskpart"




Clear the read-only attribute





Time to get the disk online





Once the disk in online, re-launch "Computer Management" from Administrative Tools and navigate to "Disk Management", you should see the "Initialize Disk" pop-up.

You should be able to perform a quick format on this disk now.





You have a drive that can be used which actually resides on GlusterFS volume.






Viewing all articles
Browse latest Browse all 10

Trending Articles