Ask Your Question
0

Why doesn't my instance recognise more space in the disk after a cinder expansion?

asked 2014-03-31 13:16:03 -0500

Diogo Vieira gravatar image

updated 2014-04-02 10:54:08 -0500

I had an instance with a 2GB cinder volume that I expanded to 10GB but it still reports the volume as having 2GB. Interestingly, making a snapshot of the instance and booting from the new volume it reports the disk as having 10GB. Can someone help me?

Updated with the cinder config:

####################
# cinder.conf sample #
####################

[DEFAULT]

#
# Options defined in cinder.exception
#

# make exception message format errors fatal (boolean value)
#fatal_exception_format_errors=false


#
# Options defined in cinder.policy
#

# JSON file representing policy (string value)
#policy_file=policy.json

# Rule checked when requested rule is not found (string value)
#policy_default_rule=default


#
# Options defined in cinder.quota
#

# number of volumes allowed per project (integer value)
#quota_volumes=10

# number of volume snapshots allowed per project (integer
# value)
#quota_snapshots=10

# number of volume gigabytes (snapshots are also included)
# allowed per project (integer value)
#quota_gigabytes=1000

# number of seconds until a reservation expires (integer
# value)
#reservation_expire=86400

# count of reservations until usage is refreshed (integer
# value)
#until_refresh=0

# number of seconds between subsequent usage refreshes
# (integer value)
#max_age=0

# default driver to use for quota checks (string value)
#quota_driver=cinder.quota.DbQuotaDriver

# whether to use default quota class for default quota
# (boolean value)
#use_default_quota_class=true


#
# Options defined in cinder.service
#

# seconds between nodes reporting state to datastore (integer
# value)
#report_interval=10

# seconds between running periodic tasks (integer value)
#periodic_interval=60

# range of seconds to randomly delay when starting the
# periodic task scheduler to reduce stampeding. (Disable by
# setting to 0) (integer value)
#periodic_fuzzy_delay=60

# IP address for OpenStack Volume API to listen (string value)
#osapi_volume_listen=0.0.0.0
osapi_volume_listen=0.0.0.0

# port for os volume api to listen (integer value)
#osapi_volume_listen_port=8776


#
# Options defined in cinder.test
#

# File name of clean sqlite db (string value)
#sqlite_clean_db=clean.sqlite

# should we use everything for testing (boolean value)
#fake_tests=true


#
# Options defined in cinder.wsgi
#

# Number of backlog requests to configure the socket with
# (integer value)
#backlog=4096

# Sets the value of TCP_KEEPIDLE in seconds for each server
# socket. Not supported on OS X. (integer value)
#tcp_keepidle=600

# CA certificate file to use to verify connecting clients
# (string value)
#ssl_ca_file=<None>

# Certificate file to use when starting the server securely
# (string value)
#ssl_cert_file=<None>

# Private key file to use when starting the server securely
# (string value)
#ssl_key_file=<None>


#
# Options defined in cinder.api.common
#

# the maximum number of items returned in a single response
# from a collection resource (integer value)
#osapi_max_limit=1000

# Base URL that will be presented to users in links to the
# OpenStack Volume API (string value)
#osapi_volume_base_URL=<None>


#
# Options defined in cinder.api.middleware.auth
#

# Treat X-Forwarded-For as the canonical remote address. Only
# enable this if you have a sanitizing proxy. (boolean value)
#use_forwarded_for=false


#
# Options defined in cinder.api.middleware.sizelimit
#

# Max size for body of a request (integer value)
#osapi_max_request_body_size=114688


#
# Options defined in cinder.backup.drivers.ceph
#

# Ceph config file to use. (string value)
#backup_ceph_conf=/etc/ceph/ceph.conf

# the Ceph user to connect with (string value)
#backup_ceph_user=cinder

# the chunk ...
(more)
edit retag flag offensive close merge delete

Comments

Did you resize the partition? If you recreate it, then you are probably forcing cloud-init to run again which will grow the root partition. If you do it while it's running then you have to grow it instead.

mpetason gravatar imagempetason ( 2014-03-31 13:41:03 -0500 )edit

No because fdisk tells me that the disk is 2GB. The problem is not the partition that was not resized but rather the instance doesn't recognises the expanded disk.

Diogo Vieira gravatar imageDiogo Vieira ( 2014-04-01 03:55:34 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2014-03-31 15:26:11 -0500

SamYaple gravatar image

updated 2014-04-01 09:35:05 -0500

You cannot resize a disk on a running instance. The the disk geometry needs to be reread. This is why your snapshotted one works.

You may be able to use some tools to get it to recognize the new, larger disk. You can also detach and reattach the disk. A reboot is always required for a root disk.


Summarizing the comments below:

The disk must first be detached from all instances and in an "Available" state. After that, you can extend the volume with cinder. Once the volume is extended, you can reattach the volume to an instance.

edit flag offensive delete link more

Comments

I'm not sure if the instance was running or not but I think it wasn't. The disk has already been attached and detached several times because I tried to run it on several instances and every one recognises it as a 2GB disk. And I also rebooted the instance too. Do you have any idea of the tools I might use to recognise the larger disk?

Diogo Vieira gravatar imageDiogo Vieira ( 2014-04-01 03:53:22 -0500 )edit

So the procedure you used was Detach Disk->Resize Disk->Reattach Disk? If so, then you may have found a bug. Can you post your cinder config and logs from the time your are trying to do an extend and reporduce the issue please?

SamYaple gravatar imageSamYaple ( 2014-04-01 08:26:38 -0500 )edit

I believe I didn't detach the disk, no. I meant I just had the instance shutdown. Shouldn't this be sufficient?

Diogo Vieira gravatar imageDiogo Vieira ( 2014-04-01 08:42:49 -0500 )edit
1

I believe you must detach the disk first. Almost nothing can happen with a volume when it is in an attached state.

SamYaple gravatar imageSamYaple ( 2014-04-01 09:03:56 -0500 )edit

Oh ok, so that might be it. What should I do now? Use my snapshot volume instead of the first one?

Diogo Vieira gravatar imageDiogo Vieira ( 2014-04-01 09:06:43 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2014-03-31 13:16:03 -0500

Seen: 1,515 times

Last updated: Apr 02 '14